Skip to content

Commit

Permalink
test: improve tests for @queries_records #296
Browse files Browse the repository at this point in the history
- Previously, asserting the status code was unreachable
  • Loading branch information
MRichards99 committed Feb 14, 2022
1 parent 5193af1 commit dd94c1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_queries_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def test_valid_error_raised(
def raise_exception():
raise raised_exception()

with pytest.raises(expected_exception) as ctx:
try:
raise_exception()
except Exception as e:
assert e.status_code == status_code

assert ctx.exception.status_code == status_code
with pytest.raises(expected_exception):
raise_exception()

0 comments on commit dd94c1a

Please sign in to comment.