Skip to content

Commit 0f730d0

Browse files
committed
!squash wip not done yet
1 parent 0817514 commit 0f730d0

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/libvcs/pytest_plugin.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def clean() -> None:
180180
return path
181181

182182

183-
@pytest.fixture
183+
@pytest.fixture(scope="session")
184184
def remote_repos_path(
185185
user_path: pathlib.Path,
186186
request: pytest.FixtureRequest,
@@ -288,9 +288,9 @@ def git_remote_repo_single_commit_post_init(remote_repo_path: pathlib.Path) -> N
288288
run(["git", "commit", "-m", "test file for dummyrepo"], cwd=remote_repo_path)
289289

290290

291-
@pytest.fixture
291+
@pytest.fixture(scope="session")
292292
@skip_if_git_missing
293-
def git_remote_repo(remote_repos_path: pathlib.Path) -> pathlib.Path:
293+
def session_git_remote_repo(remote_repos_path: pathlib.Path) -> pathlib.Path:
294294
"""Pre-made git repo w/ 1 commit, used as a file:// remote to clone and push to."""
295295
return _create_git_remote_repo(
296296
remote_repos_path=remote_repos_path,
@@ -300,6 +300,17 @@ def git_remote_repo(remote_repos_path: pathlib.Path) -> pathlib.Path:
300300
)
301301

302302

303+
@pytest.fixture
304+
@skip_if_git_missing
305+
def git_remote_repo(
306+
session_git_remote_repo: pathlib.Path, tmp_path: pathlib.Path
307+
) -> pathlib.Path:
308+
"""Copy the session-scoped Git repository to a temporary directory."""
309+
temp_repo_path = tmp_path / session_git_remote_repo.name
310+
shutil.copytree(session_git_remote_repo, temp_repo_path)
311+
return temp_repo_path
312+
313+
303314
def _create_svn_remote_repo(
304315
remote_repos_path: pathlib.Path,
305316
remote_repo_name: str,

0 commit comments

Comments
 (0)