Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/beacon: use fixture for user_defined_request_timeout tests #3509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/beacon/test_async_beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,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 = 0.001
with pytest.raises(TimeoutError):
await beacon.get_validators()
await async_beacon.get_validators()


# Beacon endpoint tests:
Expand Down
4 changes: 2 additions & 2 deletions tests/beacon/test_beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def test_cl_beacon_raises_exception_on_invalid_url(beacon):
beacon._make_get_request(BASE_URL + "/eth/v1/beacon/nonexistent")


def test_beacon_user_defined_request_timeout():
beacon = Beacon(base_url=BASE_URL, request_timeout=0.001)
def test_beacon_user_defined_request_timeout(beacon):
beacon.request_timeout = 0.001
with pytest.raises(Timeout):
beacon.get_validators()

Expand Down