summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/execfile.py5
-rw-r--r--tests/test_process.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py
index 2ca9f55f..2a3776bf 100644
--- a/coverage/execfile.py
+++ b/coverage/execfile.py
@@ -136,6 +136,11 @@ class PyRunner:
# directory.
for ext in [".py", ".pyc", ".pyo"]:
try_filename = os.path.join(self.arg0, "__main__" + ext)
+ # 3.8.10 changed how files are reported when running a
+ # directory. But I'm not sure how far this change is going to
+ # spread, so I'll just hard-code it here for now.
+ if env.PYVERSION >= (3, 8, 10):
+ try_filename = os.path.abspath(try_filename)
if os.path.exists(try_filename):
self.arg0 = try_filename
break
diff --git a/tests/test_process.py b/tests/test_process.py
index 18774ef3..a912debb 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -849,7 +849,7 @@ class EnvironmentTest(CoverageTest):
expected = re_lines(expected, r'\s+"argv0":', match=False)
actual = re_lines(actual, r'\s+"argv0":', match=False)
- assert expected == actual
+ assert actual == expected
def test_coverage_run_is_like_python(self):
with open(TRY_EXECFILE) as f: