diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-04-11 08:58:56 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-04-11 09:13:36 -0400 |
commit | 16f54a935a1c41618e098bebdbcb77b638f40c6c (patch) | |
tree | d76db410df6de56e14f4db95354b1ff52cdcc7c3 /tests/test_files.py | |
parent | 0285af966a3942d8bd63489bd285328e96221126 (diff) | |
download | python-coveragepy-git-16f54a935a1c41618e098bebdbcb77b638f40c6c.tar.gz |
debug: label each matcher with its role
Diffstat (limited to 'tests/test_files.py')
-rw-r--r-- | tests/test_files.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index 2f1bb83b..ed6fef26 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -167,7 +167,7 @@ class MatcherTest(CoverageTest): files.canonical_filename("sub4/file5.py"), files.canonical_filename("SUB5/file6.py"), ] - tm = TreeMatcher(trees) + tm = TreeMatcher(trees, "test") assert tm.info() == trees for filepath, matches in matches_to_try: self.assertMatches(tm, filepath, matches) @@ -190,7 +190,7 @@ class MatcherTest(CoverageTest): ('yourmain', False), ] modules = ['test', 'py.test', 'mymain'] - mm = ModuleMatcher(modules) + mm = ModuleMatcher(modules, "test") assert mm.info() == modules for modulename, matches in matches_to_try: assert mm.match(modulename) == matches, modulename @@ -203,13 +203,13 @@ class MatcherTest(CoverageTest): (self.make_file("sub3/file4.py"), True), (self.make_file("sub3/file5.c"), False), ] - fnm = FnmatchMatcher(["*.py", "*/sub2/*"]) + fnm = FnmatchMatcher(["*.py", "*/sub2/*"], "test") assert fnm.info() == ["*.py", "*/sub2/*"] for filepath, matches in matches_to_try: self.assertMatches(fnm, filepath, matches) def test_fnmatch_matcher_overload(self): - fnm = FnmatchMatcher(["*x%03d*.txt" % i for i in range(500)]) + fnm = FnmatchMatcher(["*x%03d*.txt" % i for i in range(500)], "test") self.assertMatches(fnm, "x007foo.txt", True) self.assertMatches(fnm, "x123foo.txt", True) self.assertMatches(fnm, "x798bar.txt", False) @@ -217,9 +217,9 @@ class MatcherTest(CoverageTest): def test_fnmatch_windows_paths(self): # We should be able to match Windows paths even if we are running on # a non-Windows OS. - fnm = FnmatchMatcher(["*/foo.py"]) + fnm = FnmatchMatcher(["*/foo.py"], "test") self.assertMatches(fnm, r"dir\foo.py", True) - fnm = FnmatchMatcher([r"*\foo.py"]) + fnm = FnmatchMatcher([r"*\foo.py"], "test") self.assertMatches(fnm, r"dir\foo.py", True) |