From 82c361e7e1a20df96cc9e5c443b2c18fc20b18c9 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 24 Nov 2023 02:05:29 -0500 Subject: [PATCH] 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. --- test/test_submodule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_submodule.py b/test/test_submodule.py index 68dbcc491..1e39924dd 100644 --- a/test/test_submodule.py +++ b/test/test_submodule.py @@ -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, )