Commit 2b04bbf6 authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #15079: make a test applicable to both C and Python versions of the pickle module.

Patch by Stefan Mihaila.
parents 868277ba 5a5272c3
...@@ -708,6 +708,11 @@ class AbstractPickleTests(unittest.TestCase): ...@@ -708,6 +708,11 @@ class AbstractPickleTests(unittest.TestCase):
def test_getinitargs(self): def test_getinitargs(self):
pass pass
def test_pop_empty_stack(self):
# Test issue7455
s = b'0'
self.assertRaises((pickle.UnpicklingError, IndexError), self.loads, s)
def test_metaclass(self): def test_metaclass(self):
a = use_metaclass() a = use_metaclass()
for proto in protocols: for proto in protocols:
...@@ -1424,9 +1429,6 @@ class AbstractPickleModuleTests(unittest.TestCase): ...@@ -1424,9 +1429,6 @@ class AbstractPickleModuleTests(unittest.TestCase):
# Test issue4298 # Test issue4298
s = bytes([0x58, 0, 0, 0, 0x54]) s = bytes([0x58, 0, 0, 0, 0x54])
self.assertRaises(EOFError, pickle.loads, s) self.assertRaises(EOFError, pickle.loads, s)
# Test issue7455
s = b'0'
self.assertRaises(pickle.UnpicklingError, pickle.loads, s)
class AbstractPersistentPicklerTests(unittest.TestCase): class AbstractPersistentPicklerTests(unittest.TestCase):
......
...@@ -695,6 +695,7 @@ Alexis Métaireau ...@@ -695,6 +695,7 @@ Alexis Métaireau
Steven Miale Steven Miale
Trent Mick Trent Mick
Stan Mihai Stan Mihai
Stefan Mihaila
Aristotelis Mikropoulos Aristotelis Mikropoulos
Chad Miller Chad Miller
Damien Miller Damien Miller
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment