Skip to content

Commit

Permalink
Fix deprecated usage of pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Feb 25, 2024
1 parent 5784039 commit 578e6c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ class TestDeprecatedTimeoutKwarg:
This class should be removed when the socket_timeout argument is removed.
"""
def setup(self):
def setup_method(self):
# Create and apply a fresh patch for each test.
self.async_sock = patch(
'thriftpy2.contrib.aio.rpc.TAsyncSocket',
side_effect=RuntimeError,
).__enter__()

def teardown_(self):
def teardown_method(self):
self.async_sock.__exit__() # Clean up patch

@pytest.mark.asyncio
Expand Down

0 comments on commit 578e6c5

Please sign in to comment.