forked from bazel-contrib/rules_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoverage.patch
More file actions
17 lines (16 loc) · 595 Bytes
/
coverage.patch
File metadata and controls
17 lines (16 loc) · 595 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Because of how coverage is run, the current directory is the first in
# sys.path. This is a problem for the tests, because they may import a module of
# the same name as a module in the current directory.
#
# NOTE @aignas 2023-06-05: we have to do this before anything from coverage gets
# imported.
diff --git a/coverage/__main__.py b/coverage/__main__.py
index ce2d8db..7d7d0a0 100644
--- a/coverage/__main__.py
+++ b/coverage/__main__.py
@@ -6,5 +6,6 @@
from __future__ import annotations
import sys
+sys.path.append(sys.path.pop(0))
from coverage.cmdline import main
sys.exit(main())