diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-01 07:51:46 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-01 08:54:48 -0500 |
commit | 54eb890e24713c5375cce7005f78bf2863f7f901 (patch) | |
tree | 8893857cb0dbe9bb06cee75f3e678bd90a02c361 | |
parent | b87f145aad6984a0d06599f7836aad969df23d5e (diff) | |
download | python-coveragepy-git-54eb890e24713c5375cce7005f78bf2863f7f901.tar.gz |
test: don't add tests conditionally, skip them instead
This keeps the total number of tests the same in all situations.
-rw-r--r-- | tests/test_files.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index 85fb6dbb..5d00bca8 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -561,13 +561,12 @@ class PathAliasesTest(CoverageTest): self.assert_mapped(aliases, '/foo/bar/d1/x.py', './mysrc1/x.py') self.assert_mapped(aliases, '/foo/bar/d2/y.py', './mysrc2/y.py') - # The root test case was added for the manylinux Docker images, - # and I'm not sure how it should work on Windows, so skip it. - cases = [".", "..", "../other"] - if not env.WINDOWS: - cases += ["/"] - @pytest.mark.parametrize("dirname", cases) + @pytest.mark.parametrize("dirname", [".", "..", "../other", "/"]) def test_dot(self, dirname): + if env.WINDOWS and dirname == "/": + # The root test case was added for the manylinux Docker images, + # and I'm not sure how it should work on Windows, so skip it. + pytest.skip("Don't know how to handle root on Windows") aliases = PathAliases() aliases.add(dirname, '/the/source') the_file = os.path.join(dirname, 'a.py') |