Skip to content

Commit

Permalink
Correct TestSubmodule.test_rename xfail condition
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EliahKagan committed Nov 25, 2023
1 parent 0f8cd4c commit 82c361e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/test_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,13 +950,14 @@ def test_remove_norefs(self, rwdir):
assert not sm.exists()

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

0 comments on commit 82c361e

Please sign in to comment.