Skip to content

Commit 52efb4d

Browse files
committed
test(fix): make the fullcoverage test work on 3.11
It didn't work because the os module is frozen on 3.11, so it gets no measurement. Use -X to disable the frozen modules feature for the test.
1 parent b40a805 commit 52efb4d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/test_process.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,6 @@ def f():
748748
@pytest.mark.expensive
749749
@pytest.mark.skipif(env.METACOV, reason="Can't test fullcoverage when measuring ourselves")
750750
@pytest.mark.skipif(not env.C_TRACER, reason="fullcoverage only works with the C tracer.")
751-
@pytest.mark.skipif(env.PYVERSION[:2] >= (3, 11), reason="this test needs work on 3.11")
752-
# https://github.com/nedbat/coveragepy/issues/1278
753751
def test_fullcoverage(self):
754752
# fullcoverage is a trick to get stdlib modules measured from
755753
# the very beginning of the process. Here we import os and
@@ -764,7 +762,7 @@ def test_fullcoverage(self):
764762
)
765763
self.set_environ("FOOEY", "BOO")
766764
self.set_environ("PYTHONPATH", fullcov)
767-
out = self.run_command("python -m coverage run -L getenv.py")
765+
out = self.run_command("python -X frozen_modules=off -m coverage run -L getenv.py")
768766
assert out == "FOOEY == BOO\n"
769767
data = coverage.CoverageData()
770768
data.read()

0 commit comments

Comments
 (0)