[Python-checkins] r82640 - in python/branches/release27-maint: Lib/test/test_struct.py
benjamin.peterson
python-checkins at python.org
Thu Jul 8 01:26:57 CEST 2010
Author: benjamin.peterson
Date: Thu Jul 8 01:26:57 2010
New Revision: 82640
Log:
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
........
Modified:
python/branches/release27-maint/ (props changed)
python/branches/release27-maint/Lib/test/test_struct.py
Modified: python/branches/release27-maint/Lib/test/test_struct.py
==============================================================================
--- python/branches/release27-maint/Lib/test/test_struct.py (original)
+++ python/branches/release27-maint/Lib/test/test_struct.py Thu Jul 8 01:26:57 2010
@@ -450,8 +450,10 @@
# Go beyond boundaries.
small_buf = array.array('c', ' '*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
@@ -475,8 +477,10 @@
# Go beyond boundaries.
small_buf = array.array('c', ' '*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):
with check_py3k_warnings(("buffer.. not supported in 3.x",
More information about the Python-checkins
mailing list