File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121skip_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 )
2536def 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" )
9595def projects_path (user_path : pathlib .Path , request : pytest .FixtureRequest ):
9696 """User's local checkouts and clones. Emphemeral directory."""
You can’t perform that action at this time.
0 commit comments