Skip to content

Commit 776c9e9

Browse files
committed
!squash pytest plugin
1 parent 4be1c45 commit 776c9e9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/libvcs/pytest_plugin.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,30 @@ def libvcs_test_cache_path(tmp_path_factory: pytest.TempPathFactory) -> pathlib.
281281

282282
@pytest.fixture(scope="session")
283283
def empty_git_repo_path(libvcs_test_cache_path: pathlib.Path) -> pathlib.Path:
284-
"""Return temporary directory to use as cache path for libvcs tests."""
284+
"""Return temporary directory to use for master-copy of a git repo."""
285285
return libvcs_test_cache_path / "empty_git_repo"
286286

287287

288+
@pytest.fixture(scope="session")
289+
def empty_git_bare_repo_path(libvcs_test_cache_path: pathlib.Path) -> pathlib.Path:
290+
"""Return temporary directory to use for master-copy of a bare git repo."""
291+
return libvcs_test_cache_path / "empty_git_bare_repo"
292+
293+
288294
@pytest.fixture(scope="session")
289295
@skip_if_git_missing
290296
def empty_git_bare_repo(
291-
empty_git_repo_path: pathlib.Path,
297+
empty_git_bare_repo_path: pathlib.Path,
292298
) -> pathlib.Path:
293299
"""Return factory to create git remote repo to for clone / push purposes."""
294-
if empty_git_repo_path.exists() and (empty_git_repo_path / ".git").exists():
295-
return empty_git_repo_path
300+
if (
301+
empty_git_bare_repo_path.exists()
302+
and (empty_git_bare_repo_path / ".git").exists()
303+
):
304+
return empty_git_bare_repo_path
296305

297306
return _create_git_remote_repo_full_path(
298-
remote_repo_path=empty_git_repo_path,
307+
remote_repo_path=empty_git_bare_repo_path,
299308
remote_repo_post_init=None,
300309
init_cmd_args=DEFAULT_GIT_REMOTE_REPO_CMD_ARGS, # --bare
301310
)

0 commit comments

Comments
 (0)