Skip to content

Commit 1de03d1

Browse files
committed
tests(conftest): Add hg_repo fixture
1 parent b570af1 commit 1de03d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libvcs/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from libvcs._internal.run import run, which
1414
from libvcs.projects.git import GitProject, GitRemote
15+
from libvcs.projects.hg import MercurialProject
1516

1617
skip_if_git_missing = pytest.mark.skipif(
1718
not which("git"), reason="git is not available"
@@ -333,6 +334,19 @@ def git_repo(projects_path: pathlib.Path, git_remote_repo: pathlib.Path):
333334
return git_repo
334335

335336

337+
@pytest.fixture
338+
def hg_repo(
339+
projects_path: pathlib.Path, hg_remote_repo: pathlib.Path
340+
) -> MercurialProject:
341+
"""Pre-made hg clone of remote repo checked out to user's projects dir."""
342+
hg_repo = MercurialProject(
343+
url=f"file://{hg_remote_repo}",
344+
dir=str(projects_path / "hg_repo"),
345+
)
346+
hg_repo.obtain()
347+
return hg_repo
348+
349+
336350
@pytest.fixture(autouse=True)
337351
def add_doctest_fixtures(
338352
doctest_namespace: dict[str, Any],

0 commit comments

Comments
 (0)