Skip to content

Commit 82c361e

Browse files
committed
Correct TestSubmodule.test_rename xfail condition
The xfail mark was added in 42a3d74, where the XPASS status on 3.7 was observed but not included in the condition. It turns out this seems to XPASS on a much wider range of versions: all but 3.12. Currently 3.12.0 is the latest stable version and no testing has been done with alpha for 3.13. Most likely whatever causes this test to fail on 3.12 would also apply to 3.13, but because I don't understand the cause, I don't want to guess that, and instead wrote the new condition to expect failure only on 3.12.* versions.
1 parent 0f8cd4c commit 82c361e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_submodule.py

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

952952
@pytest.mark.xfail(
953-
os.name == "nt",
953+
os.name == "nt" and (3, 12) <= sys.version_info < (3, 13),
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."
960961
),
961962
raises=PermissionError,
962963
)

0 commit comments

Comments
 (0)