From d4efaf5ce946fc43b6de7741df3a9673da3f435d Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Fri, 14 Feb 2025 19:23:16 +0000 Subject: [PATCH] gh-129269: Exclude everything in sys.path in `test_coverage_ignore` 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. --- Lib/test/test_trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py index e7e42531916d0d..bf54c9995376d6 100644 --- a/Lib/test/test_trace.py +++ b/Lib/test/test_trace.py @@ -390,7 +390,7 @@ def test_coverage_ignore(self): 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):