Skip to content

Commit

Permalink
Fix deprecated usage of pytest.warns
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Feb 25, 2024
1 parent 4dfee14 commit dc937ef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,13 @@ async def _make_client(warning=None, **kwargs):
is emitted (if any) and that the patch is properly applied by
consuming the RuntimeError.
"""
with pytest.warns(warning),\
pytest.raises(RuntimeError): # Consume error
await make_aio_client(addressbook.AddressBookService, **kwargs)
if warning:
with pytest.warns(warning),\
pytest.raises(RuntimeError): # Consume error
await make_aio_client(addressbook.AddressBookService, **kwargs)
else:
with pytest.raises(RuntimeError): # Consume error
await make_aio_client(addressbook.AddressBookService, **kwargs)

def _given_timeout(self):
"""Get the timeout provided to TAsyncSocket."""
Expand Down

0 comments on commit dc937ef

Please sign in to comment.