Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb66be7c

Browse files
committed
Replace xfail with gc.collect in TestSubmodule.test_rename
Like the xfail was, this is conditional, being done only in thespecific situation the PermissionError occurs. Besides that it doesnot always run even on Windows (only in 3.12 and later), thisresembles various other conditional and non-conditional gc.collectcalls.It had previously appeared to me that two calls to gc.collect wererequired, but I am unable to reproduce that. It may have beenspecific to how I was running it on my system at that time. Theneed for only one call may have been brought about by changes tothe code in the mean time, but I have tested that only one callappears required even without the changes in#1765.
1 parentf62df52 commitb66be7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎test/test_submodule.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,12 @@ def test_rename(self, rwdir):
958958
assertsm.rename(sm_name)issmandsm.name==sm_name
959959
assertnotsm.repo.is_dirty(index=True,working_tree=False,untracked_files=False)
960960

961+
# This is needed to work around a PermissionError on Windows, resembling others,
962+
# except new in Python 3.12. (*Maybe* this could be due to changes in CPython's
963+
# garbage collector detailed in https://github.com/python/cpython/issues/97922.)
964+
ifos.name=="nt"andsys.version_info>= (3,12):
965+
gc.collect()
966+
961967
new_path="renamed/myname"
962968
assertsm.move(new_path).name==new_path
963969

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp