[Python-checkins] r67002 - in python/trunk/Lib/test: test_bytes.py test_xrange.py

hirokazu.yamamoto python-checkins at python.org
Thu Oct 23 02:37:34 CEST 2008


Author: hirokazu.yamamoto
Date: Thu Oct 23 02:37:33 2008
New Revision: 67002
Log:
Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL.
Modified:
 python/trunk/Lib/test/test_bytes.py
 python/trunk/Lib/test/test_xrange.py
Modified: python/trunk/Lib/test/test_bytes.py
==============================================================================
--- python/trunk/Lib/test/test_bytes.py	(original)
+++ python/trunk/Lib/test/test_bytes.py	Thu Oct 23 02:37:33 2008
@@ -397,7 +397,7 @@
 self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b''))
 
 def test_pickling(self):
- for proto in range(pickle.HIGHEST_PROTOCOL):
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
 for b in b"", b"a", b"abc", b"\xffab\x80", b"0円0円377円0円0円":
 b = self.type2test(b)
 ps = pickle.dumps(b, proto)
@@ -947,7 +947,7 @@
 a = ByteArraySubclass(b"abcd")
 a.x = 10
 a.y = ByteArraySubclass(b"efgh")
- for proto in range(pickle.HIGHEST_PROTOCOL):
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
 b = pickle.loads(pickle.dumps(a, proto))
 self.assertNotEqual(id(a), id(b))
 self.assertEqual(a, b)
Modified: python/trunk/Lib/test/test_xrange.py
==============================================================================
--- python/trunk/Lib/test/test_xrange.py	(original)
+++ python/trunk/Lib/test/test_xrange.py	Thu Oct 23 02:37:33 2008
@@ -61,7 +61,7 @@
 def test_pickling(self):
 testcases = [(13,), (0, 11), (-22, 10), (20, 3, -1),
 (13, 21, 3), (-2, 2, 2)]
- for proto in range(pickle.HIGHEST_PROTOCOL):
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
 for t in testcases:
 r = xrange(*t)
 self.assertEquals(list(pickle.loads(pickle.dumps(r, proto))),


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /