diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-12-27 04:19:48 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-12-27 04:19:48 (GMT) |
commit | 0fc074758670e56bcc61123a641a345cbe1988e3 (patch) | |
tree | a99483147f5392d1795c098e2444a2fa9df16f7b /Lib/test/test_array.py | |
parent | 1e551b47d368e3a84ec084c1082b74393a586303 (diff) | |
download | cpython-0fc074758670e56bcc61123a641a345cbe1988e3.zip cpython-0fc074758670e56bcc61123a641a345cbe1988e3.tar.gz cpython-0fc074758670e56bcc61123a641a345cbe1988e3.tar.bz2 |
Issue #4740: Use HIGHEST_PROTOCOL in pickle test.
(There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2)
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-x | Lib/test/test_array.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 2efbc7d..2c4c2fd 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -7,7 +7,7 @@ import unittest from test import test_support from weakref import proxy import array, cStringIO -from cPickle import loads, dumps +from cPickle import loads, dumps, HIGHEST_PROTOCOL class ArraySubclass(array.array): pass @@ -97,7 +97,7 @@ class BaseTest(unittest.TestCase): self.assertEqual(a, b) def test_pickle(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode, self.example) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) @@ -112,7 +112,7 @@ class BaseTest(unittest.TestCase): self.assertEqual(type(a), type(b)) def test_pickle_for_empty_array(self): - for protocol in (0, 1, 2): + for protocol in range(HIGHEST_PROTOCOL + 1): a = array.array(self.typecode) b = loads(dumps(a, protocol)) self.assertNotEqual(id(a), id(b)) |