Skip to content

Commit 9f97a84

Browse files
committed
chore: Move pytest_ignore_collect to the top
1 parent fbc9511 commit 9f97a84

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

libvcs/conftest.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
skip_if_hg_missing = pytest.mark.skipif(not which("hg"), reason="hg is not available")
2222

2323

24+
def pytest_ignore_collect(path, config: pytest.Config):
25+
if not which("svn") and any(needle in path for needle in ["svn", "subversion"]):
26+
return True
27+
if not which("git") and "git" in path:
28+
return True
29+
if not which("hg") and any(needle in path for needle in ["hg", "mercurial"]):
30+
return True
31+
32+
return False
33+
34+
2435
@pytest.fixture(autouse=True)
2536
def home_default(monkeypatch: pytest.MonkeyPatch, user_path: pathlib.Path):
2637
monkeypatch.setenv("HOME", str(user_path))
@@ -80,17 +91,6 @@ def hgconfig(user_path: pathlib.Path):
8091
return hgrc
8192

8293

83-
def pytest_ignore_collect(path, config: pytest.Config):
84-
if not which("svn") and any(needle in path for needle in ["svn", "subversion"]):
85-
return True
86-
if not which("git") and "git" in path:
87-
return True
88-
if not which("hg") and any(needle in path for needle in ["hg", "mercurial"]):
89-
return True
90-
91-
return False
92-
93-
9494
@pytest.fixture(scope="function")
9595
def projects_path(user_path: pathlib.Path, request: pytest.FixtureRequest):
9696
"""User's local checkouts and clones. Emphemeral directory."""

0 commit comments

Comments
 (0)