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

Commit2940662

Browse files
committed
Test that version_info is not pickled
That is, that its value is not pickle serialized/deserialized, butalways recomputed with a subprocess call the first time it isaccessed even on a Git instance that is created by unpickling.
1 parentee385bd commit2940662

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎test/test_git.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,18 @@ def test_version_info_cache_is_per_instance(self):
533533
git2.version_info
534534
git1.version_info
535535

536+
deftest_version_info_cache_is_not_pickled(self):
537+
with_rollback_refresh():
538+
with_fake_git(123,456,789)aspath:
539+
git1=Git()
540+
refresh(path)
541+
git1.version_info
542+
git2=pickle.loads(pickle.dumps(git1))
543+
os.remove(path)# Arrange that the second subprocess call will fail.
544+
withself.assertRaises(GitCommandNotFound):
545+
git2.version_info
546+
git1.version_info
547+
536548
deftest_successful_refresh_with_arg_invalidates_cached_version_info(self):
537549
with_rollback_refresh():
538550
with_fake_git(11,111,1)aspath1:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp