We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 831013f commit 5177fffCopy full SHA for 5177fff
1 file changed
tests/test_utils.py
@@ -644,15 +644,14 @@ def test_is_sentry_url_no_client():
644
],
645
)
646
def test_get_error_message(error, expected_result):
647
- with pytest.raises(BaseException) as exc_value:
648
- exc_value.message = error
649
- raise Exception
650
- assert get_error_message(exc_value) == expected_result(exc_value)
651
-
652
653
- exc_value.detail = error
654
655
+ class CustomException(Exception):
+ def __str__(self):
+ return expected_result(self)
+
+ with pytest.raises(CustomException) as exc:
+ raise CustomException
+ assert get_error_message(exc.value) == expected_result(exc.value)
656
657
658
def test_safe_str_fails():
0 commit comments