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

Appearance settings

Commit c208b95

Browse filesBrowse files
committed
pytest plugin(hg): Set HGRCPATH for hg_remote_repo_single_commit_post_init()
1 parent 27ab59c commit c208b95
Copy full SHA for c208b95

File tree

Expand file treeCollapse file tree

1 file changed

+11
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-5
lines changed

‎src/libvcs/pytest_plugin.py

Copy file name to clipboardExpand all lines: src/libvcs/pytest_plugin.py
+11-5Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,15 @@ def _create_hg_remote_repo(
558558
return remote_repo_path
559559

560560

561-
def hg_remote_repo_single_commit_post_init(remote_repo_path: pathlib.Path) -> None:
561+
def hg_remote_repo_single_commit_post_init(
562+
remote_repo_path: pathlib.Path,
563+
env: "_ENV | None" = None,
564+
) -> None:
562565
"""Post-initialization: Create a test mercurial repo with a single commit."""
563566
testfile_filename = "testfile.test"
564-
run(["touch", testfile_filename], cwd=remote_repo_path)
565-
run(["hg", "add", testfile_filename], cwd=remote_repo_path)
566-
run(["hg", "commit", "-m", "test file for hg repo"], cwd=remote_repo_path)
567+
run(["touch", testfile_filename], cwd=remote_repo_path, env=env)
568+
run(["hg", "add", testfile_filename], cwd=remote_repo_path, env=env)
569+
run(["hg", "commit", "-m", "test file for hg repo"], cwd=remote_repo_path, env=env)
567570

568571

569572
@pytest.fixture(scope="session")
@@ -625,10 +628,13 @@ def fn(
625628
def hg_remote_repo(
626629
remote_repos_path: pathlib.Path,
627630
create_hg_remote_repo: CreateRepoPytestFixtureFn,
631+
hgconfig: pathlib.Path,
628632
) -> pathlib.Path:
629633
"""Pre-made, file-based repo for push and pull."""
630634
repo_path = create_hg_remote_repo()
631-
hg_remote_repo_single_commit_post_init(remote_repo_path=repo_path)
635+
hg_remote_repo_single_commit_post_init(
636+
remote_repo_path=repo_path, env={"HGRCPATH": str(hgconfig)}
637+
)
632638
return repo_path
633639

634640

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.