Skip to content

Commit

Permalink
new pytest raises syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
nllong committed Oct 2, 2024
1 parent 0c8747c commit 95f176c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_apibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ def __init__(self):
api = TestAPI()
with pytest.raises(APIClientError) as conm:
api._get()
exception = conm.exception
self.assertEqual("APIClientError: id is a compulsory field", str(exception))
self.assertEqual("id is a compulsory field", conm.value.args[0])
api._get(id=1)
self.assertTrue(mock_requests.get.called)

Expand Down

0 comments on commit 95f176c

Please sign in to comment.