-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Get Rid of Hypothesis Deprecation Warnings #1729
Comments
I'm interested in working on this issue. |
Hello, does this issue still need fixing? Looking for a first contribution to make, and I would love to put my efforts towards Etherium:) |
Yes it does, and we'd love help! You can see the full list of warnings on any of the latest core test runs on CircleCI. The py36-core tests can be found here, and you can see the warnings in the |
yep!
Since we're not having problems with the scope now, I'd start with the largest scope you can (which I believe is session, but I'm not sure on that) and then make the scope narrower as you run into issues. We've done a few of these before - this PR is a good example. We ended up moving all of the functions related to the Emitter fixture to a module scope, and moved it into the file where it was actually used. You'll likely need to do something similar. Let me know if you have more questions! |
Hey there @kclowes ! Has this issue been resolved? If no, then I would like to have a go at it? |
@smishy05 It would be great if you wanted to have a go! Let me know if you have questions. Thanks! |
Thanks a lot for the reply! Yup, I will let you know if I face any issues. |
* Added conftest.py to test/core/utilities and moved web3 fixture to it Moved fixtures into test_contract_topic_filter.py Both of these were to fix HypothesisDeprecationWarning while running test Co-authored-by: kclowes <kclowes@users.noreply.github.com>
@kclowes this issue can be closed. |
Thanks! |
What was wrong?
At the end of our core tests, we have a Deprecation Warning that looks like:
HypothesisDeprecationWarning: tests/core/utilities/test_event_filter_builder.py::test_match_any_bytes_type_properties uses the 'web3' fixture, which is reset between function calls but not between test cases generated by
@given(...). You can change it to a module- or session-scoped fixture if it is safe to reuse; if not we recommend using a context manager inside your test function. See https://docs.pytest.org/en/latest/fixture.html#sharing-test-data for details on fixture scope.
Actual output can be found in this test run.
How can it be fixed?
Add the appropriate scope to each fixture. This will need to be done in multiple PRs.
The text was updated successfully, but these errors were encountered: