Skip to content

Commit 0cc1baf

Browse files
cliffhallclaude
andauthored
test(git): close the fixture repository before removing it
GitPython keeps `git cat-file` processes whose cwd is inside the repository; on Windows shutil.rmtree then fails with WinError 32 and 40 of 47 tests error at teardown. Closing the repo first fixes it and unblocks #1149. Part of #4855 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 281257c commit 0cc1baf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/git/tests/test_server.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def test_repository(tmp_path: Path):
3333

3434
yield test_repo
3535

36+
# Close GitPython's persistent `git cat-file` processes first: on Windows
37+
# their cwd is inside the repository, so rmtree fails with WinError 32
38+
# (#4855, unblocks #1149).
39+
test_repo.close()
3640
shutil.rmtree(repo_path)
3741

3842

0 commit comments

Comments
 (0)