Skip to content

Commit d7efa37

Browse files
codexByron
authored andcommitted
Close submodule fixture handles before testing moves on Windows
The Python package CI job test (windows, 3.13) failed both test_move_normal_destination cases with WinError 32 during os.renames(): the newly cloned checkout was still held open. The intermediate-symlink rejection cases and leaf-link compatibility cases passed; the latter already close a module repository while snapshotting state. Close the fixture module repository before yielding it, reusing Repo.close() and its Windows handle cleanup. This lets the normal-move tests exercise destination validation without depending on garbage-collection timing. Production behavior is unchanged. Validation: all 30 focused move cases pass locally, along with Ruff lint and formatting and git diff --check. Windows verification will come from the next CI run.
1 parent 5a1b6f3 commit d7efa37

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

test/test_submodule.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def movable_submodule(tmp_path):
6060
with _patch_git_config("protocol.file.allow", "always"):
6161
submodule = parent.create_submodule("logical-name", "module", source.working_tree_dir)
6262
parent.index.commit("Create submodule")
63+
# Release clone handles before Windows moves the checkout.
64+
submodule.module().close()
6365
yield submodule
6466

6567

0 commit comments

Comments
 (0)