Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d78f84d

Browse files
committed
refactor: pytest_ignore_collect to return False, which after needle match
1 parent 65c1b43 commit d78f84d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎src/libvcs/pytest_plugin.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,17 @@ def __next__(self) -> str:
106106

107107
def pytest_ignore_collect(collection_path: pathlib.Path, config: pytest.Config) -> bool:
108108
"""Skip tests if VCS binaries are missing."""
109-
if notshutil.which("svn") andany(
109+
if any(
110110
needle in str(collection_path) for needle in ["svn", "subversion"]
111-
):
111+
)andnotshutil.which("svn"):
112112
return True
113-
if notshutil.which("git") and "git"instr(collection_path):
113+
if "git"instr(collection_path) and notshutil.which("git"):
114114
return True
115-
return bool(
116-
not shutil.which("hg")
117-
and any(needle in str(collection_path) for needle in ["hg", "mercurial"]),
118-
)
115+
if any( # NOQA: SIM103
116+
needle in str(collection_path) for needle in ["hg", "mercurial"]
117+
) and not shutil.which("hg"):
118+
return True
119+
return False
119120

120121

121122
@pytest.fixture(scope="session")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /