mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
this makes checking for warnings less error prone
This commit is contained in:
parent
0b00b6b987
commit
8e93f4e791
1 changed files with 2 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue