diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-07 23:26:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-07 23:26:57 (GMT) |
commit | 86ac22e33833329906f1a68b5b771a8989ce6823 (patch) | |
tree | 25335bf9234519b0cca87dbd6790502b24c9964b /Lib | |
parent | 90c0718052b27b76f2006b9125d7858ec41c6546 (diff) | |
download | cpython-86ac22e33833329906f1a68b5b771a8989ce6823.zip cpython-86ac22e33833329906f1a68b5b771a8989ce6823.tar.gz cpython-86ac22e33833329906f1a68b5b771a8989ce6823.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
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_struct.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 1877192..f376ac3 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -450,8 +450,10 @@ class StructTest(unittest.TestCase): # 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 @@ class StructTest(unittest.TestCase): # 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", |