From 30f271b81440c9cbe4643e267b48b16a97044d3e Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Mon, 7 Oct 2024 22:32:56 -0700 Subject: [PATCH] test_async_beacon.py: fix Unclosed client session in test_async_beacon_user_request_timeout Signed-off-by: Lukas Rusak --- tests/beacon/test_async_beacon.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/beacon/test_async_beacon.py b/tests/beacon/test_async_beacon.py index 27105a8e5b..b32b0ae75c 100644 --- a/tests/beacon/test_async_beacon.py +++ b/tests/beacon/test_async_beacon.py @@ -3,6 +3,9 @@ randint, ) +from aiohttp import ( + ClientTimeout, +) from aiohttp.client_exceptions import ( InvalidURL, ) @@ -46,10 +49,10 @@ async def test_async_cl_beacon_raises_exception_on_invalid_url(async_beacon): @pytest.mark.asyncio -async def test_async_beacon_user_request_timeout(): - beacon = AsyncBeacon(base_url=BASE_URL, request_timeout=0.001) +async def test_async_beacon_user_request_timeout(async_beacon): + async_beacon.request_timeout = ClientTimeout(0.001) with pytest.raises(TimeoutError): - await beacon.get_validators() + await async_beacon.get_validators() # Beacon endpoint tests: