]> granicus.if.org Git - python/commitdiff
test_pickle: speed up test_long
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 23 Nov 2013 20:20:49 +0000 (21:20 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 23 Nov 2013 20:20:49 +0000 (21:20 +0100)
Lib/test/pickletester.py

index cadc5a701e18e524b303335cda2cddf1474a5425..34e46f686c1dd731acbb00b4733396f4898ed4dd 100644 (file)
@@ -722,7 +722,11 @@ class AbstractPickleTests(unittest.TestCase):
         for n in nbase, -nbase:
             p = self.dumps(n, 2)
             got = self.loads(p)
-            self.assert_is_copy(n, got)
+            # assert_is_copy is very expensive here as it precomputes
+            # a failure message by computing the repr() of n and got,
+            # we just do the check ourselves.
+            self.assertIs(type(got), int)
+            self.assertEqual(n, got)
 
     def test_float(self):
         test_values = [0.0, 4.94e-324, 1e-310, 7e-308, 6.626e-34, 0.1, 0.5,