Skip to content

Commit 7856400

Browse files
committed
tests(sync[preservation]): Unwrap RepoFixtureResult in crash fixture
why: git_repo, hg_repo, and svn_repo return RepoFixtureResult wrappers, so instantiating a fresh sync instance from the template fixture needs type(template.repo). what: - Unwrap template.repo before constructing the disposable checkout
1 parent ac44097 commit 7856400

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tests/sync/test_preservation_crash.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def checkout(request: pytest.FixtureRequest, tmp_path: pathlib.Path) -> Checkout
142142
remote_template = pathlib.Path(template.url.removeprefix("file://"))
143143
remote = tmp_path / "remote"
144144
shutil.copytree(remote_template, remote)
145-
repo = type(template)(url=remote.as_uri(), path=tmp_path / "source")
145+
repo_cls = type(template.repo) if hasattr(template, "repo") else type(template)
146+
repo = repo_cls(url=remote.as_uri(), path=tmp_path / "source")
146147
repo.obtain()
147148
for name in ("local.txt", "advance.txt"):
148149
(repo.path / name).write_text("base\n")

0 commit comments

Comments
 (0)