Skip to content

Commit 2d6311b

Browse files
committed
Test version_info on unpickled Git instance
The new test doesn't pass yet, as gitpython-developers#1836 is not yet fixed.
1 parent 2eac36c commit 2d6311b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/test_git.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111
import os.path as osp
1212
from pathlib import Path
13+
import pickle
1314
import re
1415
import shutil
1516
import subprocess
@@ -329,12 +330,20 @@ def test_persistent_cat_file_command(self):
329330
self.assertEqual(typename, typename_two)
330331
self.assertEqual(size, size_two)
331332

332-
def test_version(self):
333+
def test_version_info(self):
334+
"""The version_info attribute is a tuple of ints."""
333335
v = self.git.version_info
334336
self.assertIsInstance(v, tuple)
335337
for n in v:
336338
self.assertIsInstance(n, int)
337-
# END verify number types
339+
340+
def test_version_info_pickleable(self):
341+
"""The version_info attribute is usable on unpickled Git instances."""
342+
deserialized = pickle.loads(pickle.dumps(self.git))
343+
v = deserialized.version_info
344+
self.assertIsInstance(v, tuple)
345+
for n in v:
346+
self.assertIsInstance(n, int)
338347

339348
def test_git_exc_name_is_git(self):
340349
self.assertEqual(self.git.git_exec_name, "git")

0 commit comments

Comments
 (0)