|
2 | 2 | import pathlib
|
3 | 3 | import shutil
|
4 | 4 | import textwrap
|
5 |
| -import typing as t |
6 | 5 |
|
7 | 6 | import pytest
|
8 | 7 |
|
9 |
| -from libvcs._internal.run import run |
10 |
| -from libvcs._internal.shortcuts import create_project |
11 |
| -from libvcs.sync.git import GitSync |
12 |
| - |
13 | 8 |
|
14 | 9 | @pytest.fixture(autouse=True, scope="session")
|
15 | 10 | def home_path(tmp_path_factory: pytest.TempPathFactory):
|
@@ -66,50 +61,6 @@ def clean():
|
66 | 61 | return dir
|
67 | 62 |
|
68 | 63 |
|
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 |
| - |
113 | 64 | @pytest.fixture(autouse=True, scope="session")
|
114 | 65 | def hgrc(user_path: pathlib.Path):
|
115 | 66 | hgrc = user_path / ".hgrc"
|
|
0 commit comments