Skip to content

Commit

Permalink
test_async_beacon.py: fix Unclosed client session in test_async_beaco…
Browse files Browse the repository at this point in the history
…n_user_request_timeout

Signed-off-by: Lukas Rusak <[email protected]>
  • Loading branch information
lrusak committed Oct 8, 2024
1 parent 787e613 commit 30f271b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/beacon/test_async_beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
randint,
)

from aiohttp import (
ClientTimeout,
)
from aiohttp.client_exceptions import (
InvalidURL,
)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 30f271b

Please sign in to comment.