mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 13:16:52 +03:00
assert_warning() checks in case of multiple warnings
This commit is contained in:
parent
5919c87afb
commit
8693c63173
|
@ -69,9 +69,13 @@ class PillowTestCase(unittest.TestCase):
|
||||||
result = func()
|
result = func()
|
||||||
|
|
||||||
# Verify some things.
|
# Verify some things.
|
||||||
self.assertEqual(len(w), 1)
|
self.assertGreaterEqual(len(w), 1)
|
||||||
assert issubclass(w[-1].category, warn_class)
|
found = False
|
||||||
self.assertIn("deprecated", str(w[-1].message))
|
for v in w:
|
||||||
|
if issubclass(v.category, warn_class):
|
||||||
|
found = True
|
||||||
|
break
|
||||||
|
self.assertTrue(found)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# # require that deprecation warnings are triggered
|
# # require that deprecation warnings are triggered
|
||||||
|
|
Loading…
Reference in New Issue
Block a user