summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-12-27 04:21:44 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-12-27 04:21:44 (GMT)
commit801f9d3888f4e2f44fe5aa7e9e46f8620a60702f (patch)
tree2f03e47c1ac595cb6db3fdeb1c5354753b2d0307 /Lib/test/test_array.py
parent81d90a220f2cea407e261a3c884d388a084d2d1e (diff)
downloadcpython-801f9d3888f4e2f44fe5aa7e9e46f8620a60702f.zip
cpython-801f9d3888f4e2f44fe5aa7e9e46f8620a60702f.tar.gz
cpython-801f9d3888f4e2f44fe5aa7e9e46f8620a60702f.tar.bz2
Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for protocol 3
(== HIGHEST_PROTOCOL in 3.x)
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 5a505de..2b80a7d 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -7,7 +7,7 @@ import unittest
from test import support
from weakref import proxy
import array, io, math
-from pickle import loads, dumps
+from pickle import loads, dumps, HIGHEST_PROTOCOL
import operator
class ArraySubclass(array.array):
@@ -98,7 +98,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))
@@ -113,7 +113,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))