diff options
author | Sam Gross <colesbury@gmail.com> | 2025-02-20 10:13:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-20 10:13:44 -0500 |
commit | 35925e952911aba97bfdaee85b09d734ceac4fea (patch) | |
tree | 912f4fdba3ea51735286e267bb129cad224f6bf9 | |
parent | 8cbcf51d614815df3ab7ea557f04e6b4b386968e (diff) | |
download | cpython-35925e952911aba97bfdaee85b09d734ceac4fea.tar.gz cpython-35925e952911aba97bfdaee85b09d734ceac4fea.zip |
gh-129269: Exclude everything in sys.path in `test_coverage_ignore` (gh-130133)
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.
-rw-r--r-- | Lib/test/test_trace.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py index e7e42531916..bf54c999537 100644 --- a/Lib/test/test_trace.py +++ b/Lib/test/test_trace.py @@ -390,7 +390,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): |