summaryrefslogtreecommitdiff
path: root/tests/test_files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-01-31 10:10:47 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-01-31 10:10:47 -0500
commitd02be78c3a0ee3022be56c623bb9bdcad1e9acd4 (patch)
tree1e74153bb4741f6a9e2f1e1f55d2b9960a490bb3 /tests/test_files.py
parenta035bde3320a501720ae722dc6b54fe7ff5c8647 (diff)
downloadpython-coveragepy-git-d02be78c3a0ee3022be56c623bb9bdcad1e9acd4.tar.gz
style: fix long lines and avoid backslashesnedbat/unittest2pytest
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index 1e0ddcfb..6a9556ec 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -66,8 +66,7 @@ class FilesTest(CoverageTest):
assert canonical_path == self.abs_path('file1.py')
# After the filename has been converted, it should be in the cache.
assert 'sub/proj1/file1.py' in files.CANONICAL_FILENAME_CACHE
- assert files.canonical_filename('sub/proj1/file1.py') == \
- self.abs_path('file1.py')
+ assert files.canonical_filename('sub/proj1/file1.py') == self.abs_path('file1.py')
@pytest.mark.parametrize("original, flat", [
@@ -148,8 +147,8 @@ class MatcherTest(CoverageTest):
def assertMatches(self, matcher, filepath, matches):
"""The `matcher` should agree with `matches` about `filepath`."""
canonical = files.canonical_filename(filepath)
- assert matcher.match(canonical) == matches, \
- "File %s should have matched as %s" % (filepath, matches)
+ msg = "File %s should have matched as %s" % (filepath, matches)
+ assert matches == matcher.match(canonical), msg
def test_tree_matcher(self):
matches_to_try = [
@@ -187,12 +186,9 @@ class MatcherTest(CoverageTest):
]
modules = ['test', 'py.test', 'mymain']
mm = ModuleMatcher(modules)
- assert mm.info() == \
- modules
+ assert mm.info() == modules
for modulename, matches in matches_to_try:
- assert mm.match(modulename) == \
- matches, \
- modulename
+ assert mm.match(modulename) == matches, modulename
def test_fnmatch_matcher(self):
matches_to_try = [