def test_func(self): with asserts.assert_raises_regex( SomeError, expected_regex=MSG_EXPECTED_EXCEPTION, extras=MOCK_EXTRA): raise AttributeError(MSG_UNEXPECTED_EXCEPTION)
def test_func(self): with asserts.assert_raises_regex( SomeError, expected_regex=MSG_EXPECTED_EXCEPTION, extras=MOCK_EXTRA): raise SomeError(wrong_msg)