We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6ce407 commit 4068a36Copy full SHA for 4068a36
tests/snippets/try_exceptions.py
@@ -126,18 +126,14 @@ def __init__(self):
126
except ZeroDivisionError as ex:
127
assert type(ex.__cause__) == NameError
128
129
-try:
+with assertRaises(NameError):
130
try:
131
raise NameError
132
except:
133
raise
134
-except NameError:
135
- pass
136
137
+with assertRaises(RuntimeError):
138
139
-except RuntimeError:
140
141
142
context = None
143
0 commit comments