Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for protocol 3

(== HIGHEST_PROTOCOL in 3.x)
This commit is contained in:
Hirokazu Yamamoto 2008-12-27 04:21:44 +00:00
parent 81d90a220f
commit 801f9d3888
3 changed files with 6 additions and 6 deletions

View file

@ -375,7 +375,7 @@ class TestBasic(unittest.TestCase):
def test_pickle(self):
d = deque(range(200))
for i in (0, 1, 2):
for i in range(pickle.HIGHEST_PROTOCOL + 1):
s = pickle.dumps(d, i)
e = pickle.loads(s)
self.assertNotEqual(id(d), id(e))
@ -384,7 +384,7 @@ class TestBasic(unittest.TestCase):
## def test_pickle_recursive(self):
## d = deque('abc')
## d.append(d)
## for i in (0, 1, 2):
## for i in range(pickle.HIGHEST_PROTOCOL + 1):
## e = pickle.loads(pickle.dumps(d, i))
## self.assertNotEqual(id(d), id(e))
## self.assertEqual(id(e), id(e[-1]))