summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-02 17:59:11 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-02 17:59:11 (GMT)
commit3c67d795ef829114a6404a8d3d6e53f277e7cd84 (patch)
tree2ce5287f41c333d1299ba0f1a7d63ffaebc0848c /Lib/test/pickletester.py
parentd156c2d782d1c598a4c97bc5192f383ce9669674 (diff)
downloadcpython-3c67d795ef829114a6404a8d3d6e53f277e7cd84.zip
cpython-3c67d795ef829114a6404a8d3d6e53f277e7cd84.tar.gz
cpython-3c67d795ef829114a6404a8d3d6e53f277e7cd84.tar.bz2
Implemented proto 2 NEWTRUE and NEWFALSE in cPickle.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 7214298..f1a1384 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -502,6 +502,12 @@ class AbstractPickleTests(unittest.TestCase):
y = self.loads(s)
self.assert_(x is y, (proto, x, s, y))
+ # Test that proto >= 2 really uses the bool opcodes.
+ if proto >= 2 and x in (False, True):
+ expected = x and pickle.NEWTRUE or pickle.NEWFALSE
+ # Skip the PROTO opcode at the start.
+ self.assertEqual(s[2], expected)
+
def test_newobj_tuple(self):
x = MyTuple([1, 2, 3])
x.foo = 42