diff --git a/src/libvcs/pytest_plugin.py b/src/libvcs/pytest_plugin.py index 0e6e9710..889cdad9 100644 --- a/src/libvcs/pytest_plugin.py +++ b/src/libvcs/pytest_plugin.py @@ -108,16 +108,17 @@ def __next__(self) -> str: def pytest_ignore_collect(collection_path: pathlib.Path, config: pytest.Config) -> bool: """Skip tests if VCS binaries are missing.""" - if not shutil.which("svn") and any( + if any( needle in str(collection_path) for needle in ["svn", "subversion"] - ): + ) and not shutil.which("svn"): return True - if not shutil.which("git") and "git" in str(collection_path): + if "git" in str(collection_path) and not shutil.which("git"): return True - return bool( - not shutil.which("hg") - and any(needle in str(collection_path) for needle in ["hg", "mercurial"]), - ) + if any( # NOQA: SIM103 + needle in str(collection_path) for needle in ["hg", "mercurial"] + ) and not shutil.which("hg"): + return True + return False @pytest.fixture(scope="session") diff --git a/tests/sync/test_hg.py b/tests/sync/test_hg.py index de643f81..87af043a 100644 --- a/tests/sync/test_hg.py +++ b/tests/sync/test_hg.py @@ -16,14 +16,6 @@ pytestmark = pytest.mark.skip(reason="hg is not available") -@pytest.fixture(autouse=True) -def set_hgconfig( - set_hgconfig: pathlib.Path, -) -> pathlib.Path: - """Set mercurial configuration.""" - return set_hgconfig - - def test_hg_sync( tmp_path: pathlib.Path, projects_path: pathlib.Path,