summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-09 13:33:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-07-09 13:33:03 (GMT)
commit0b00b6b98729beaf3ae03c714fdec8ef797f9ae0 (patch)
tree67febe39e778294cfff0785bad0b6eb67f1c0e93 /Lib/test/test_struct.py
parentf6cbdcbf69597fd2467d7c6e8279e20ad9b494a8 (diff)
downloadcpython-0b00b6b98729beaf3ae03c714fdec8ef797f9ae0.zip
cpython-0b00b6b98729beaf3ae03c714fdec8ef797f9ae0.tar.gz
cpython-0b00b6b98729beaf3ae03c714fdec8ef797f9ae0.tar.bz2
Merged revisions 82739,82741 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82739 | benjamin.peterson | 2010-07-09 08:28:42 -0500 (Fri, 09 Jul 2010) | 1 line allow more exceptions ........ r82741 | benjamin.peterson | 2010-07-09 08:31:11 -0500 (Fri, 09 Jul 2010) | 1 line wrap ........
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r--Lib/test/test_struct.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index e5241b3..16c2b9e 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -62,8 +62,8 @@ class StructTest(unittest.TestCase):
self.assertRaises(struct.error, struct.pack, 'iii', 3)
self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
- self.assertRaises(struct.error, struct.pack, 'i', 'foo')
- self.assertRaises(struct.error, struct.pack, 'P', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
self.assertRaises(struct.error, struct.unpack, 'd', 'flap')
s = struct.pack('ii', 1, 2)
self.assertRaises(struct.error, struct.unpack, 'iii', s)
@@ -458,7 +458,8 @@ class StructTest(unittest.TestCase):
# Test bogus offset (issue 3694)
sb = small_buf
- self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
+ self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
+ None)
def test_pack_into_fn(self):
test_string = 'Reykjavik rocks, eow!'