TestNamedTuple.test_pickle was only testing through protocol 2. Changed to have it...
authorEric V. Smith <eric@trueblade.com>
Wed, 5 Feb 2014 15:33:14 +0000 (10:33 -0500)
committerEric V. Smith <eric@trueblade.com>
Wed, 5 Feb 2014 15:33:14 +0000 (10:33 -0500)
Lib/test/test_collections.py

index 56e812070582f828ab1db52ad02cdd03680e7153..ee28a6c0b35f2b6d648142ca4c90c23d982968b6 100644 (file)
@@ -301,7 +301,7 @@ class TestNamedTuple(unittest.TestCase):
         for module in (pickle,):
             loads = getattr(module, 'loads')
             dumps = getattr(module, 'dumps')
-            for protocol in -1, 0, 1, 2:
+            for protocol in range(-1, module.HIGHEST_PROTOCOL + 1):
                 q = loads(dumps(p, protocol))
                 self.assertEqual(p, q)
                 self.assertEqual(p._fields, q._fields)