]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129269: Exclude everything in sys.path in `test_coverage_ignore` (gh-130133...
authorSam Gross <colesbury@gmail.com>
Thu, 20 Feb 2025 15:42:47 +0000 (10:42 -0500)
committerGitHub <noreply@github.com>
Thu, 20 Feb 2025 15:42:47 +0000 (15:42 +0000)
The `test_trace.test_coverage_ignore` test would fail if you had
`setuptools` installed, such as in `~/.local/lib/python3.xxx/site-packages/`.
Ignore everything in `sys.path` when running the test.
(cherry picked from commit 35925e952911aba97bfdaee85b09d734ceac4fea)

Lib/test/test_trace.py

index 7ff3fe4091dfa45402acc1dd7a98d3330fee2eac..f02745985e723927577920d291933d75fb956ce8 100644 (file)
@@ -392,7 +392,7 @@ class TestCoverage(unittest.TestCase):
         libpath = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
         # sys.prefix does not work when running from a checkout
         tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,
-                             libpath], trace=0, count=1)
+                             libpath] + sys.path, trace=0, count=1)
         with captured_stdout() as stdout:
             self._coverage(tracer)
         if os.path.exists(TESTFN):