From: Eric V. Smith Date: Wed, 5 Feb 2014 15:33:14 +0000 (-0500) Subject: TestNamedTuple.test_pickle was only testing through protocol 2. Changed to have it... X-Git-Tag: v3.4.0rc1~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d5d69d452d37bfc29d8f182cb4b99a344f0dadb;p=thirdparty%2FPython%2Fcpython.git TestNamedTuple.test_pickle was only testing through protocol 2. Changed to have it automatically test through the most recent version. --- diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 56e812070582..ee28a6c0b35f 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -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)