From 4dfee140fdc9ebbc29e9c97df3892dbde6bf22a7 Mon Sep 17 00:00:00 2001 From: AN Long Date: Sun, 25 Feb 2024 17:53:05 +0800 Subject: [PATCH] Fix deprecated usage of pytest --- tests/test_aio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_aio.py b/tests/test_aio.py index a5603f9e..c1243c17 100644 --- a/tests/test_aio.py +++ b/tests/test_aio.py @@ -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