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

Appearance settings

Commit fb20670

Browse filesBrowse files
committed
refactor: pytest_ignore_collect to return False, which after needle match
1 parent 78b091e commit fb20670
Copy full SHA for fb20670

File tree

Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-7
lines changed

‎src/libvcs/pytest_plugin.py

Copy file name to clipboardExpand all lines: src/libvcs/pytest_plugin.py
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ def __next__(self) -> str:
108108

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

122123

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.