Skip to content

Commit 94db3b0

Browse files
committed
refactor(conftest): Remove local repo fixtures
1 parent 94dbe14 commit 94db3b0

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

tests/conftest.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
import pathlib
33
import shutil
44
import textwrap
5-
import typing as t
65

76
import pytest
87

9-
from libvcs._internal.run import run
10-
from libvcs._internal.shortcuts import create_project
11-
from libvcs.sync.git import GitSync
12-
138

149
@pytest.fixture(autouse=True, scope="session")
1510
def home_path(tmp_path_factory: pytest.TempPathFactory):
@@ -66,50 +61,6 @@ def clean():
6661
return dir
6762

6863

69-
@pytest.fixture
70-
def git_repo_kwargs(repos_path: pathlib.Path, git_dummy_repo_dir):
71-
"""Return kwargs for :func:`create_project`."""
72-
return {
73-
"url": "git+file://" + git_dummy_repo_dir,
74-
"dir": str(repos_path / "repo_name"),
75-
"name": "repo_name",
76-
}
77-
78-
79-
class DummyRepoProtocol(t.Protocol):
80-
"""Callback for repo fixture factory."""
81-
82-
def __call__(self, repo_name: str, testfile_filename: str = ...) -> str:
83-
"""Callback signature for subprocess communication."""
84-
...
85-
86-
87-
@pytest.fixture
88-
def create_git_dummy_repo(
89-
repos_path: pathlib.Path,
90-
) -> t.Generator[DummyRepoProtocol, None, None]:
91-
def fn(repo_name: str, testfile_filename: str = "testfile.test"):
92-
repo_path = str(repos_path / repo_name)
93-
94-
run(["git", "init", repo_name], cwd=str(repos_path))
95-
96-
run(["touch", testfile_filename], cwd=repo_path)
97-
run(["git", "add", testfile_filename], cwd=repo_path)
98-
run(["git", "commit", "-m", "test file for %s" % repo_name], cwd=repo_path)
99-
100-
return repo_path
101-
102-
yield fn
103-
104-
105-
@pytest.fixture
106-
def git_dummy_repo_dir(
107-
repos_path: pathlib.Path, create_git_dummy_repo: DummyRepoProtocol
108-
):
109-
"""Create a git repo with 1 commit, used as a remote."""
110-
return create_git_dummy_repo("dummyrepo")
111-
112-
11364
@pytest.fixture(autouse=True, scope="session")
11465
def hgrc(user_path: pathlib.Path):
11566
hgrc = user_path / ".hgrc"

0 commit comments

Comments
 (0)