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

Commitd8cad75

Browse files
committed
fix tests the fast way
1 parent21e21d0 commitd8cad75

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

‎test/test_index.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,16 @@ def test_index_file_diffing(self, rw_repo):
385385
try:
386386
index.checkout(test_file)
387387
exceptCheckoutErrorase:
388-
self.assertEqual(len(e.failed_files),1)
389-
self.assertEqual(e.failed_files[0],osp.basename(test_file))
390-
self.assertEqual(len(e.failed_files),len(e.failed_reasons))
391-
self.assertIsInstance(e.failed_reasons[0],str)
392-
self.assertEqual(len(e.valid_files),0)
393-
withopen(test_file,'rb')asfd:
394-
s=fd.read()
395-
self.assertTrue(s.endswith(append_data),s)
388+
# detailed exceptions are only possible in older git versions
389+
ifrw_repo.git._version_info< (2,29):
390+
self.assertEqual(len(e.failed_files),1)
391+
self.assertEqual(e.failed_files[0],osp.basename(test_file))
392+
self.assertEqual(len(e.failed_files),len(e.failed_reasons))
393+
self.assertIsInstance(e.failed_reasons[0],str)
394+
self.assertEqual(len(e.valid_files),0)
395+
withopen(test_file,'rb')asfd:
396+
s=fd.read()
397+
self.assertTrue(s.endswith(append_data),s)
396398
else:
397399
raiseAssertionError("Exception CheckoutError not thrown")
398400

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp