[Python-checkins] r82739 - python/branches/py3k/Lib/test/test_struct.py
benjamin.peterson
python-checkins at python.org
Fri Jul 9 15:28:42 CEST 2010
Author: benjamin.peterson
Date: Fri Jul 9 15:28:42 2010
New Revision: 82739
Log:
allow more exceptions
Modified:
python/branches/py3k/Lib/test/test_struct.py
Modified: python/branches/py3k/Lib/test/test_struct.py
==============================================================================
--- python/branches/py3k/Lib/test/test_struct.py (original)
+++ python/branches/py3k/Lib/test/test_struct.py Fri Jul 9 15:28:42 2010
@@ -47,8 +47,8 @@
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', b'flap')
s = struct.pack('ii', 1, 2)
self.assertRaises(struct.error, struct.unpack, 'iii', s)
@@ -446,7 +446,7 @@
# Test bogus offset (issue 3694)
sb = small_buf
- self.assertRaises(TypeError, struct.pack_into, b'', sb, None)
+ self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb, None)
def test_pack_into_fn(self):
test_string = b'Reykjavik rocks, eow!'
More information about the Python-checkins
mailing list