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 f584444 commit 5b3b02bCopy full SHA for 5b3b02b
testing/test_compat.py
@@ -146,6 +146,10 @@ async def bar():
146
147
148
class ErrorsHelper:
149
+ @property
150
+ def raise_baseexception(self):
151
+ raise BaseException("base exception should be raised")
152
+
153
@property
154
def raise_exception(self):
155
raise Exception("exception should be catched")
@@ -167,6 +171,8 @@ def test_safe_getattr():
167
171
helper = ErrorsHelper()
168
172
assert safe_getattr(helper, "raise_exception", "default") == "default"
169
173
assert safe_getattr(helper, "raise_fail", "default") == "default"
174
+ with pytest.raises(BaseException):
175
+ assert safe_getattr(helper, "raise_baseexception", "default")
170
176
177
178
def test_safe_isclass():
0 commit comments