Skip to content

Commit 2814263

Browse files
committed
Add a missing PermissionError xfail on Windows
One of the tests that was commented as being skipped as a result of SkipTest rasied in git.util.rmtree or one of the functions that calls it, test_git_submodule_compatibility, was not skipped in that way and was actually failing on Windows with PermissionError. It appears that the cause of failure changed over time, so that it once involved rmtree but no longer does. This removes the outdated comment and adds an xfail mark instead, specific to PermissionError and with a message identifying where in the test case's logic the PermissionError is currently triggered.
1 parent 8107cbf commit 2814263

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: test/test_submodule.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,11 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
819819
assert commit_sm.binsha == sm_too.binsha
820820
assert sm_too.binsha != sm.binsha
821821

822-
# @skipIf(HIDE_WINDOWS_KNOWN_ERRORS, ## ACTUALLY skipped by `git.submodule.base#L869`.
823-
# "FIXME: helper.wrapper fails with: PermissionError: [WinError 5] Access is denied: "
824-
# "'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\test_work_tree_unsupportedryfa60di\\master_repo\\.git\\objects\\pack\\pack-bc9e0787aef9f69e1591ef38ea0a6f566ec66fe3.idx") # noqa E501
822+
@pytest.mark.xfail(
823+
HIDE_WINDOWS_KNOWN_ERRORS,
824+
reason='"The process cannot access the file because it is being used by another process" on call to sm.move',
825+
raises=PermissionError,
826+
)
825827
@with_rw_directory
826828
def test_git_submodule_compatibility(self, rwdir):
827829
parent = git.Repo.init(osp.join(rwdir, "parent"))

0 commit comments

Comments
 (0)