Replace some for loops, and other minor changes (#8660)
* Replace for loop using the operator * Replace for loop with a generator expression inside any() * Replace for loop with a dictionary comprehension * Use list comprehension * Simplify arguments for range() * Change newfuncargs variable to in-line dictionary comprehension * is_ancestor: return base.is_relative_to(query) * Remove unneeded import of pathlib * Try using PurePath * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Import PurePath on new line * Revert and remove is_relative_to Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -145,10 +145,7 @@ def _is_doctest(config: Config, path: Path, parent: Collector) -> bool:
|
||||
if path.suffix in (".txt", ".rst") and parent.session.isinitpath(path):
|
||||
return True
|
||||
globs = config.getoption("doctestglob") or ["test*.txt"]
|
||||
for glob in globs:
|
||||
if fnmatch_ex(glob, path):
|
||||
return True
|
||||
return False
|
||||
return any(fnmatch_ex(glob, path) for glob in globs)
|
||||
|
||||
|
||||
class ReprFailDoctest(TerminalRepr):
|
||||
|
||||
Reference in New Issue
Block a user