summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-06-12 03:10:02 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-06-12 03:10:02 (GMT)
commit75f25f2c9a4646746efbc056b4d2a07b40f93964 (patch)
treedc99b42d2c9e31672d27a37659ccf68951526916 /Lib/test/pickletester.py
parentf501942c764d25f29a2e06ba5c9917b149c7189b (diff)
downloadcpython-75f25f2c9a4646746efbc056b4d2a07b40f93964.zip
cpython-75f25f2c9a4646746efbc056b4d2a07b40f93964.tar.gz
cpython-75f25f2c9a4646746efbc056b4d2a07b40f93964.tar.bz2
revert the addition of _pickle because it was causing havok with 64-bit
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index c9ebdb8..783d361 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -362,7 +362,7 @@ def create_data():
return x
class AbstractPickleTests(unittest.TestCase):
- # Subclass must define self.dumps, self.loads.
+ # Subclass must define self.dumps, self.loads, self.error.
_testdata = create_data()
@@ -463,9 +463,8 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(list(x[0].attr.keys()), [1])
self.assert_(x[0].attr[1] is x)
- def test_get(self):
- self.assertRaises(KeyError, self.loads, b'g0\np0')
- self.assertEquals(self.loads(b'((Kdtp0\nh\x00l.))'), [(100,), (100,)])
+ def test_garyp(self):
+ self.assertRaises(self.error, self.loads, b'garyp')
def test_insecure_strings(self):
# XXX Some of these tests are temporarily disabled
@@ -956,7 +955,7 @@ class AbstractPickleModuleTests(unittest.TestCase):
f = open(TESTFN, "wb")
try:
f.close()
- self.assertRaises(ValueError, pickle.dump, 123, f)
+ self.assertRaises(ValueError, self.module.dump, 123, f)
finally:
os.remove(TESTFN)
@@ -965,24 +964,24 @@ class AbstractPickleModuleTests(unittest.TestCase):
f = open(TESTFN, "wb")
try:
f.close()
- self.assertRaises(ValueError, pickle.dump, 123, f)
+ self.assertRaises(ValueError, self.module.dump, 123, f)
finally:
os.remove(TESTFN)
def test_highest_protocol(self):
# Of course this needs to be changed when HIGHEST_PROTOCOL changes.
- self.assertEqual(pickle.HIGHEST_PROTOCOL, 3)
+ self.assertEqual(self.module.HIGHEST_PROTOCOL, 3)
def test_callapi(self):
from io import BytesIO
f = BytesIO()
# With and without keyword arguments
- pickle.dump(123, f, -1)
- pickle.dump(123, file=f, protocol=-1)
- pickle.dumps(123, -1)
- pickle.dumps(123, protocol=-1)
- pickle.Pickler(f, -1)
- pickle.Pickler(f, protocol=-1)
+ self.module.dump(123, f, -1)
+ self.module.dump(123, file=f, protocol=-1)
+ self.module.dumps(123, -1)
+ self.module.dumps(123, protocol=-1)
+ self.module.Pickler(f, -1)
+ self.module.Pickler(f, protocol=-1)
class AbstractPersistentPicklerTests(unittest.TestCase):