Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf72e282

Browse files
committed
Mark test_diff_submodule xfail on Windows
Everything attempted in the test case method is actually workingand passes, but when the tearDown method calls shutil.rmtree, itfails with "Access is denied" and raises PermissionError. Thereason and exception are accordingly noted in the xfail decoration.While adding a pytest import to apply the pytest xfail mark, I alsoimproved grouping/sorting of other imports in the test_diff module.
1 parentcd9d7a9 commitf72e282

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

‎test/test_diff.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,17 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
importddt
6+
importos
7+
importos.pathasosp
78
importshutil
89
importtempfile
9-
fromgitimport (
10-
Repo,
11-
GitCommandError,
12-
Diff,
13-
DiffIndex,
14-
NULL_TREE,
15-
Submodule,
16-
)
17-
fromgit.cmdimportGit
18-
fromtest.libimport (
19-
TestBase,
20-
StringProcessAdapter,
21-
fixture,
22-
)
23-
fromtest.libimportwith_rw_directory
2410

25-
importos.pathasosp
11+
importddt
12+
importpytest
13+
14+
fromgitimportNULL_TREE,Diff,DiffIndex,GitCommandError,Repo,Submodule
15+
fromgit.cmdimportGit
16+
fromtest.libimportStringProcessAdapter,TestBase,fixture,with_rw_directory
2617

2718

2819
defto_raw(input):
@@ -318,6 +309,11 @@ def test_diff_with_spaces(self):
318309
self.assertIsNone(diff_index[0].a_path,repr(diff_index[0].a_path))
319310
self.assertEqual(diff_index[0].b_path,"file with spaces",repr(diff_index[0].b_path))
320311

312+
@pytest.mark.xfail(
313+
os.name=="nt",
314+
reason='"Access is denied" when tearDown calls shutil.rmtree',
315+
raises=PermissionError,
316+
)
321317
deftest_diff_submodule(self):
322318
"""Test that diff is able to correctly diff commits that cover submodule changes"""
323319
# Init a temp git repo that will be referenced as a submodule.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp