diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-07-09 18:15:28 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-07-09 18:15:28 (GMT) |
commit | 8e93f4e791d9e0fab7a40d1c95f5071f166f8390 (patch) | |
tree | 62ba767eabe5b8b6904c6c9a171c23a56220e1f0 /Lib/test/test_struct.py | |
parent | 0b00b6b98729beaf3ae03c714fdec8ef797f9ae0 (diff) | |
download | cpython-8e93f4e791d9e0fab7a40d1c95f5071f166f8390.zip cpython-8e93f4e791d9e0fab7a40d1c95f5071f166f8390.tar.gz cpython-8e93f4e791d9e0fab7a40d1c95f5071f166f8390.tar.bz2 |
this makes checking for warnings less error prone
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 16c2b9e..816cedb 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -317,9 +317,8 @@ class StructTest(unittest.TestCase): randrange) with check_warnings(("integer argument expected, " "got non-integer", DeprecationWarning)): - self.assertRaises((TypeError, struct.error), - struct.pack, self.format, - 3+42j) + with self.assertRaises((TypeError, struct.error)): + struct.pack(self.format, 3+42j) # an attempt to convert a non-integer (with an # implicit conversion via __int__) should succeed, |