[Python-checkins] cpython: test_pickle: speed up test_long

antoine.pitrou python-checkins at python.org
Sat Nov 23 21:38:13 CET 2013


http://hg.python.org/cpython/rev/e6f13c40a020
changeset:   87455:e6f13c40a020
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sat Nov 23 21:20:49 2013 +0100
summary:
  test_pickle: speed up test_long

files:
  Lib/test/pickletester.py |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -722,7 +722,11 @@
         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,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list