Skip to content

Commit

Permalink
Catch BaseException in safe_getattr
Browse files Browse the repository at this point in the history
  • Loading branch information
cybergrind committed Aug 21, 2017
1 parent 539523c commit ad00303
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import py

import _pytest
from _pytest.outcomes import TEST_OUTCOME


try:
Expand Down Expand Up @@ -228,7 +229,7 @@ def safe_getattr(object, name, default):
"""
try:
return getattr(object, name, default)
except Exception:
except TEST_OUTCOME:
return default


Expand Down

0 comments on commit ad00303

Please sign in to comment.