diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-10-06 17:54:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-10-06 17:54:24 -0400 |
commit | 51aacdbef7b0adf49d2487cc12f0876fc57d49ef (patch) | |
tree | 0f0098558f25f2bc8e31e12c591ee5b22731a8ef | |
parent | fe390493cf99e179f73d4c0547c7e4503b099cb2 (diff) | |
download | python-coveragepy-git-coverage-5.0a3.tar.gz |
Look up names so we don't care about casecoverage-5.0a3
-rw-r--r-- | tests/test_context.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/test_context.py b/tests/test_context.py index ee5441ee..efc05418 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -151,9 +151,8 @@ class DynamicContextTest(CoverageTest): self.start_import_stop(cov, "two_tests") data = cov.get_data() - fname = os.path.abspath("two_tests.py") - print(fname) - print(data.measured_files()) + full_names = {os.path.basename(f): f for f in data.measured_files()} + fname = full_names["two_tests.py"] self.assertCountEqual(data.measured_contexts(), ["", "test_one", "test_two"]) self.assertCountEqual(data.lines(fname, ""), self.OUTER_LINES) self.assertCountEqual(data.lines(fname, "test_one"), self.TEST_ONE_LINES) @@ -166,9 +165,8 @@ class DynamicContextTest(CoverageTest): self.start_import_stop(cov, "two_tests") data = cov.get_data() - fname = os.path.abspath("two_tests.py") - print(fname) - print(data.measured_files()) + full_names = {os.path.basename(f): f for f in data.measured_files()} + fname = full_names["two_tests.py"] self.assertCountEqual(data.measured_contexts(), ["stat", "stat:test_one", "stat:test_two"]) self.assertCountEqual(data.lines(fname, "stat"), self.OUTER_LINES) self.assertCountEqual(data.lines(fname, "stat:test_one"), self.TEST_ONE_LINES) |