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 6413a7f

Browse filesBrowse files
committed
Revert "test(sync[hg]) Use test fixture"
This reverts commit e1db75d.
1 parent 041c8a2 commit 6413a7f
Copy full SHA for 6413a7f

File tree

Expand file treeCollapse file tree

1 file changed

+6
-18
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-18
lines changed

‎tests/url/test_hg.py

Copy file name to clipboardExpand all lines: tests/url/test_hg.py
+6-18Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
"""Tests for mercurial URL module."""
22

3-
import pathlib
43
import typing
54

65
import pytest
76

8-
from libvcs.pytest_plugin import CreateRepoPytestFixtureFn
97
from libvcs.sync.hg import HgSync
108
from libvcs.url.base import RuleMap
119
from libvcs.url.hg import DEFAULT_RULES, PIP_DEFAULT_RULES, HgBaseURL, HgURL
@@ -19,16 +17,6 @@ class HgURLFixture(typing.NamedTuple):
1917
hg_url: HgURL
2018

2119

22-
@pytest.fixture
23-
def hg_repo(
24-
set_home: pathlib.Path,
25-
hgconfig: pathlib.Path,
26-
create_hg_remote_repo: CreateRepoPytestFixtureFn,
27-
) -> pathlib.Path:
28-
"""Create a remote hg repository."""
29-
return create_hg_remote_repo()
30-
31-
3220
TEST_FIXTURES: list[HgURLFixture] = [
3321
HgURLFixture(
3422
url="https://bitbucket.com/vcs-python/libvcs",
@@ -64,8 +52,8 @@ def test_hg_url(
6452
hg_repo: HgSync,
6553
) -> None:
6654
"""Test HgURL."""
67-
url = url.format(local_repo=hg_repo)
68-
hg_url.url = hg_url.url.format(local_repo=hg_repo)
55+
url = url.format(local_repo=hg_repo.path)
56+
hg_url.url = hg_url.url.format(local_repo=hg_repo.path)
6957

7058
assert HgURL.is_valid(url) == is_valid, f"{url} compatibility should be {is_valid}"
7159
assert HgURL(url) == hg_url
@@ -133,10 +121,10 @@ class HgURLWithPip(HgURL):
133121
_rule_map={m.label: m for m in [*DEFAULT_RULES, *PIP_DEFAULT_RULES]},
134122
)
135123

136-
hg_url_kwargs["url"] = hg_url_kwargs["url"].format(local_repo=hg_repo)
137-
url = url.format(local_repo=hg_repo)
124+
hg_url_kwargs["url"] = hg_url_kwargs["url"].format(local_repo=hg_repo.path)
125+
url = url.format(local_repo=hg_repo.path)
138126
hg_url = HgURLWithPip(**hg_url_kwargs)
139-
hg_url.url = hg_url.url.format(local_repo=hg_repo)
127+
hg_url.url = hg_url.url.format(local_repo=hg_repo.path)
140128

141129
assert (
142130
HgBaseURL.is_valid(url) != is_valid
@@ -198,6 +186,6 @@ def test_hg_to_url(
198186
hg_repo: HgSync,
199187
) -> None:
200188
"""Test HgURL.to_url()."""
201-
hg_url.url = hg_url.url.format(local_repo=hg_repo)
189+
hg_url.url = hg_url.url.format(local_repo=hg_repo.path)
202190

203191
assert hg_url.to_url() == expected

0 commit comments

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