diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-01 18:18:11 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-02 07:38:19 -0400 |
commit | 4c4ba2e0bc9ec663fa3772d2b088f736345a65a1 (patch) | |
tree | a03a2672bfe64141b46243274243377d86c73bb8 /coverage/files.py | |
parent | 236bc9317d208b24b418c9c167f22410613f4ade (diff) | |
download | python-coveragepy-git-4c4ba2e0bc9ec663fa3772d2b088f736345a65a1.tar.gz |
refactor: pyupgrade --py36-plus coverage/*.py
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/coverage/files.py b/coverage/files.py index f7272bd7..1f78e0b6 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -195,7 +195,7 @@ def prep_patterns(patterns): return prepped -class TreeMatcher(object): +class TreeMatcher: """A matcher for files in a tree. Construct with a list of paths, either files or directories. Paths match @@ -209,7 +209,7 @@ class TreeMatcher(object): self.name = name def __repr__(self): - return "<TreeMatcher {!r} {!r}>".format(self.name, self.original_paths) + return f"<TreeMatcher {self.name!r} {self.original_paths!r}>" def info(self): """A list of strings for displaying when dumping state.""" @@ -229,14 +229,14 @@ class TreeMatcher(object): return False -class ModuleMatcher(object): +class ModuleMatcher: """A matcher for modules in a tree.""" def __init__(self, module_names, name): self.modules = list(module_names) self.name = name def __repr__(self): - return "<ModuleMatcher {!r} {!r}>".format(self.name, self.modules) + return f"<ModuleMatcher {self.name!r} {self.modules!r}>" def info(self): """A list of strings for displaying when dumping state.""" @@ -258,7 +258,7 @@ class ModuleMatcher(object): return False -class FnmatchMatcher(object): +class FnmatchMatcher: """A matcher for files by file name pattern.""" def __init__(self, pats, name): self.pats = list(pats) @@ -266,7 +266,7 @@ class FnmatchMatcher(object): self.name = name def __repr__(self): - return "<FnmatchMatcher {!r} {!r}>".format(self.name, self.pats) + return f"<FnmatchMatcher {self.name!r} {self.pats!r}>" def info(self): """A list of strings for displaying when dumping state.""" @@ -320,7 +320,7 @@ def fnmatches_to_regex(patterns, case_insensitive=False, partial=False): return compiled -class PathAliases(object): +class PathAliases: """A collection of aliases for paths. When combining data files from remote machines, often the paths to source @@ -337,7 +337,7 @@ class PathAliases(object): def pprint(self): # pragma: debugging """Dump the important parts of the PathAliases, for debugging.""" for regex, result in self.aliases: - print("{!r} --> {!r}".format(regex.pattern, result)) + print(f"{regex.pattern!r} --> {result!r}") def add(self, pattern, result): """Add the `pattern`/`result` pair to the list of aliases. |