Skip to content

Commit

Permalink
simplify no-error check in test; https://github.com/HypothesisWorks/h…
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Dec 31, 2023
1 parent bed2cf5 commit ffe03c4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions hypothesis-python/tests/cover/test_sampled_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,8 @@ def test_error_appropriate_error_note_3819(
self, func_to_call, exp_err_cls, should_exp_msg
):
if exp_err_cls is None:
try:
func_to_call()
except BaseException as e:
pytest.fail(f"Expected call to succeed but got error: {e}")
else:
assert True
# Here we only care that no exception was raised, so nothing to assert.
func_to_call()
else:
with pytest.raises(exp_err_cls) as err_ctx:
func_to_call()
Expand Down

0 comments on commit ffe03c4

Please sign in to comment.