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

Conversation

lrusak
Copy link
Contributor

@lrusak lrusak commented Oct 12, 2024

What was wrong?

Running pytest -rP tests/beacon/test_async_beacon.py makes the following warning:

tests/beacon/test_async_beacon.py::test_async_beacon_user_request_timeout
  /home/lukas/Documents/git/web3.py/venv/lib64/python3.13/site-packages/aiohttp/client.py:417: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f9562d34a50>

The change to the synchronous beacon class test is just to make it uniform

How was it fixed?

By using the fixture so that the closure runs and cleans up the aiohttp.client.ClientSession after the test

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

This fixes the following warning:

tests/beacon/test_async_beacon.py::test_async_beacon_user_request_timeout
  /home/lukas/Documents/git/web3.py/venv/lib64/python3.13/site-packages/aiohttp/client.py:417: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f9562d34a50>

The change to the syncronous beacon class test is just to make it uniform

Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant