aboutsummaryrefslogtreecommitdiff
path: root/python/private/coverage.patch
diff options
context:
space:
mode:
Diffstat (limited to 'python/private/coverage.patch')
-rw-r--r--python/private/coverage.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/private/coverage.patch b/python/private/coverage.patch
new file mode 100644
index 0000000..cb4402e
--- /dev/null
+++ b/python/private/coverage.patch
@@ -0,0 +1,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 79aa4e2b..291fcff8 100644
+--- a/coverage/__main__.py
++++ b/coverage/__main__.py
+@@ -4,5 +4,6 @@
+ """Coverage.py's main entry point."""
+
+ import sys
++sys.path.append(sys.path.pop(0))
+ from coverage.cmdline import main
+ sys.exit(main())