From 52efb4de5e9f0ff37eeda9471d7c3aa26edfdd38 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 12 Nov 2021 20:16:27 -0500 Subject: 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. --- tests/test_process.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/test_process.py') diff --git a/tests/test_process.py b/tests/test_process.py index 58f32707..1e05c560 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -748,8 +748,6 @@ class ProcessTest(CoverageTest): @pytest.mark.expensive @pytest.mark.skipif(env.METACOV, reason="Can't test fullcoverage when measuring ourselves") @pytest.mark.skipif(not env.C_TRACER, reason="fullcoverage only works with the C tracer.") - @pytest.mark.skipif(env.PYVERSION[:2] >= (3, 11), reason="this test needs work on 3.11") - # https://github.com/nedbat/coveragepy/issues/1278 def test_fullcoverage(self): # fullcoverage is a trick to get stdlib modules measured from # the very beginning of the process. Here we import os and @@ -764,7 +762,7 @@ class ProcessTest(CoverageTest): ) self.set_environ("FOOEY", "BOO") self.set_environ("PYTHONPATH", fullcov) - out = self.run_command("python -m coverage run -L getenv.py") + out = self.run_command("python -X frozen_modules=off -m coverage run -L getenv.py") assert out == "FOOEY == BOO\n" data = coverage.CoverageData() data.read() -- cgit v1.2.1