]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 82637 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Wed, 7 Jul 2010 22:50:58 +0000 (22:50 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 7 Jul 2010 22:50:58 +0000 (22:50 +0000)
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
........

Lib/test/test_struct.py

index 88404629e0c23566553a73616750484d31e44b7a..0c1932692105905bd1a62cbcf421a64949cf48b6 100644 (file)
@@ -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