summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-07 22:50:58 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-07-07 22:50:58 (GMT)
commit003f523970b9bc8b6f0237cc55c955d8b388270d (patch)
tree10669bac16b0e7a2dd626c0ae17e51a9ec7689a2
parentf092c7c1d7bfcd07dfe621b0b21ab4ece2434c57 (diff)
downloadcpython-003f523970b9bc8b6f0237cc55c955d8b388270d.zip
cpython-003f523970b9bc8b6f0237cc55c955d8b388270d.tar.gz
cpython-003f523970b9bc8b6f0237cc55c955d8b388270d.tar.bz2
Merged revisions 82637 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82637 | benjamin.peterson | 2010-07-07 17:45:06 -0500 (Wed, 07 Jul 2010) | 1 line ValueError in this case is also acceptable ........
-rw-r--r--Lib/test/test_struct.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 8840462..0c19326 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -443,8 +443,10 @@ class StructTest(unittest.TestCase):
# Go beyond boundaries.
small_buf = array.array('b', b' '*10)
- self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string)
- self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string)
+ self.assertRaises((ValueError, struct.error), s.pack_into, small_buf, 0,
+ test_string)
+ self.assertRaises((ValueError, struct.error), s.pack_into, small_buf, 2,
+ test_string)
# Test bogus offset (issue 3694)
sb = small_buf
@@ -468,8 +470,10 @@ class StructTest(unittest.TestCase):
# Go beyond boundaries.
small_buf = array.array('b', b' '*10)
- self.assertRaises(struct.error, pack_into, small_buf, 0, test_string)
- self.assertRaises(struct.error, pack_into, small_buf, 2, test_string)
+ self.assertRaises((ValueError, struct.error), pack_into, small_buf, 0,
+ test_string)
+ self.assertRaises((ValueError, struct.error), pack_into, small_buf, 2,
+ test_string)
def test_unpack_with_buffer(self):
# SF bug 1563759: struct.unpack doens't support buffer protocol objects