Kaydet (Commit) 8e93f4e7 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

this makes checking for warnings less error prone

üst 0b00b6b9
...@@ -317,9 +317,8 @@ class StructTest(unittest.TestCase): ...@@ -317,9 +317,8 @@ class StructTest(unittest.TestCase):
randrange) randrange)
with check_warnings(("integer argument expected, " with check_warnings(("integer argument expected, "
"got non-integer", DeprecationWarning)): "got non-integer", DeprecationWarning)):
self.assertRaises((TypeError, struct.error), with self.assertRaises((TypeError, struct.error)):
struct.pack, self.format, struct.pack(self.format, 3+42j)
3+42j)
# an attempt to convert a non-integer (with an # an attempt to convert a non-integer (with an
# implicit conversion via __int__) should succeed, # implicit conversion via __int__) should succeed,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment