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

Sign up
Appearance settings

Issue: mercurial / svn missing skips git tests #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tony wants to merge 2 commits into master
base: master
Choose a base branch
Loading
from bin-installs-unused-fixtures
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/libvcs/pytest_plugin.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +117 to +121
Copy link

@sourcery-ai sourcery-ai bot Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): We've found these issues:

sourcery-ai[bot] reacted with thumbs up emoji sourcery-ai[bot] reacted with thumbs down emoji


@pytest.fixture(scope="session")
Expand Down
8 changes: 0 additions & 8 deletions tests/sync/test_hg.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /