Skip to content

Commit 0b7ee17

Browse files
committed
Refine TestSubmodule.test_rename xfail condition
This further improves the condition that was corrected in 82c361e. Testing on Python 3.13.0 alpha 2 shows the same failure as on 3.12 (that I'm at least right now consistently unable to produce on any lower versions). In addition, on both versions of CPython on Windows, the failure seems to consistently resolve if two gc.collect() are placed just above the code that calls sm.move(). A single call is consistently insufficient. I haven't included any such calls in this commit, since the focus here is on fixing xfail markings, and becuse such a change may benefit from being evaluated separately and may merit further accompanying changes. But that this behavior is exhibited on both 3.12 and the 3.13 alpha further supports removing the upper bound on the xfail marking.
1 parent 0ae5dd1 commit 0b7ee17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_submodule.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,14 @@ def test_remove_norefs(self, rwdir):
950950
assert not sm.exists()
951951

952952
@pytest.mark.xfail(
953-
os.name == "nt" and (3, 12) <= sys.version_info < (3, 13),
953+
os.name == "nt" and sys.version_info >= (3, 12),
954954
reason=(
955955
"The sm.move call fails. Submodule.move calls os.renames, which raises:\n"
956956
"PermissionError: [WinError 32] "
957957
"The process cannot access the file because it is being used by another process: "
958958
R"'C:\Users\ek\AppData\Local\Temp\test_renamekkbznwjp\parent\mymodules\myname' "
959959
R"-> 'C:\Users\ek\AppData\Local\Temp\test_renamekkbznwjp\parent\renamed\myname'"
960-
"\nThis resembles other Windows errors, but seems only to affect Python 3.12 somehow."
960+
"\nThis resembles other Windows errors, but only occurs starting in Python 3.12."
961961
),
962962
raises=PermissionError,
963963
)

0 commit comments

Comments
 (0)