summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-02 07:51:32 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-02 07:51:32 (GMT)
commitbf2674be0e95787cdeb154091b7377e30b2827bf (patch)
tree05ccb3b212ff3027587b948678959f7b6ca61546 /Lib/test/pickletester.py
parent06dd8cf5e4100303714f9e3f72b3c52330fdd51c (diff)
downloadcpython-bf2674be0e95787cdeb154091b7377e30b2827bf.zip
cpython-bf2674be0e95787cdeb154091b7377e30b2827bf.tar.gz
cpython-bf2674be0e95787cdeb154091b7377e30b2827bf.tar.bz2
long(string, base) now takes time linear in len(string) when base is a
power of 2. Enabled the tail end of test_long() in pickletester.py because it no longer takes forever when run from test_pickle.py.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 6615307..2a1ca17 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -247,7 +247,7 @@ class AbstractPickleTests(unittest.TestCase):
def test_long(self):
for proto in protocols:
- # 256 bytes is where LONG4 begins
+ # 256 bytes is where LONG4 begins.
for nbits in 1, 8, 8*254, 8*255, 8*256, 8*257:
nbase = 1L << nbits
for npos in nbase-1, nbase, nbase+1:
@@ -257,20 +257,11 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(n, got)
# Try a monster. This is quadratic-time in protos 0 & 1, so don't
# bother with those.
- # XXX Damn. pickle.py is still quadratic-time here, due to
- # XXX long(string, 16). cPickle runs this in an eyeblink, but I
- # XXX gave up waiting for pickle.py to get beyond "loading". Giving
- # XXX up for now.
- return
- print "building long"
nbase = long("deadbeeffeedface", 16)
nbase += nbase << 1000000
for n in nbase, -nbase:
- print "dumping"
p = self.dumps(n, 2)
- print "loading"
got = self.loads(p)
- print "checking"
self.assertEqual(n, got)
def test_reduce(self):