# 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())