Skip to content

Commit ff9247b

Browse files
committed
test(pytest_ignore_collect): Update to use pathlib.Path's
1 parent 483f83d commit ff9247b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

libvcs/conftest.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222
skip_if_hg_missing = pytest.mark.skipif(not which("hg"), reason="hg is not available")
2323

2424

25-
def pytest_ignore_collect(path, config: pytest.Config):
26-
if not which("svn") and any(needle in path for needle in ["svn", "subversion"]):
25+
def pytest_ignore_collect(collection_path: pathlib.Path, config: pytest.Config) -> bool:
26+
if not which("svn") and any(
27+
needle in str(collection_path) for needle in ["svn", "subversion"]
28+
):
2729
return True
28-
if not which("git") and "git" in path:
30+
if not which("git") and "git" in str(collection_path):
2931
return True
30-
if not which("hg") and any(needle in path for needle in ["hg", "mercurial"]):
32+
if not which("hg") and any(
33+
needle in str(collection_path) for needle in ["hg", "mercurial"]
34+
):
3135
return True
3236

3337
return False

0 commit comments

Comments
 (0)