summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index b1e2010..f55502a 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -620,14 +620,21 @@ class CatchWarningTests(BaseTest):
with test_support.check_warnings(('foo', UserWarning)):
wmod.warn("foo")
- with self.assertRaises(AssertionError):
+ try:
with test_support.check_warnings(('', RuntimeWarning)):
# defaults to quiet=False with argument
pass
- with self.assertRaises(AssertionError):
+ except AssertionError:
+ pass
+ else:
+ self.fail("Dind't raise AssertionError")
+ try:
with test_support.check_warnings(('foo', RuntimeWarning)):
wmod.warn("foo")
-
+ except AssertionError:
+ pass
+ else:
+ self.fail("Dind't raise AssertionError")
class CCatchWarningTests(CatchWarningTests):
module = c_warnings