From: Hirokazu Yamamoto Date: Thu, 23 Oct 2008 00:37:33 +0000 (+0000) Subject: Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL. X-Git-Tag: v2.7a1~2708 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=592c2755677d77061ceb99607c10fa7d70e5c2dd;p=thirdparty%2FPython%2Fcpython.git Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL. --- diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 2873beaf5076..a583a48027cc 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -397,7 +397,7 @@ class BaseBytesTest(unittest.TestCase): 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 @@ class ByteArraySubclassTest(unittest.TestCase): 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) diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py index 7a2eea552d65..7e2a1a305815 100644 --- a/Lib/test/test_xrange.py +++ b/Lib/test/test_xrange.py @@ -61,7 +61,7 @@ class XrangeTest(unittest.TestCase): 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))),