8000 [3.13] gh-129269: Exclude everything in sys.path in `test_coverage_ig… · python/cpython@ef66394 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef66394

Browse files
authored
[3.13] gh-129269: Exclude everything in sys.path in test_coverage_ignore (gh-130133) (gh-130357)
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 35925e9)
1 parent 0a992ff commit ef66394

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_trace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def test_coverage_ignore(self):
392392
libpath = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
393393
# sys.prefix does not work when running from a checkout
394394
tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,
395-
libpath], trace=0, count=1)
395+
libpath] + sys.path, trace=0, count=1)
396396
with captured_stdout() as stdout:
397397
self._coverage(tracer)
398398
if os.path.exists(TESTFN):

0 commit comments

Comments
 (0)
0