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

Fixes emitter fixture scoping issues #1780

Merged
merged 3 commits into from
Oct 29, 2020

Conversation

tmckenzie51
Copy link
Contributor

@tmckenzie51 tmckenzie51 commented Oct 23, 2020

What was wrong?

At the end of our tests we have hypothesis deprecation warnings that look 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.

Related to Issue #1729

How was it fixed?

emitter fixtures ('emitter', 'Emitter', 'EMITTER', EMITTER_ABI, 'EMITTER_RUNTIME', 'EMITTER_CODE') were changed to have 'module' scope for test_contract_data_filters and function scope otherwise.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

changes emitter fixtures ('emitter', 'Emitter', 'EMITTER', EMITTER_ABI, 'EMITTER_RUNTIME', 'EMITTER_CODE') to 'module scope for test_contract_data_filters and function scope otherwise.
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 💥 !

tests/core/contracts/test_contract_buildTransaction.py Outdated Show resolved Hide resolved
tests/core/filtering/test_contract_data_filters.py Outdated Show resolved Hide resolved
tests/core/filtering/test_contract_on_event_filtering.py Outdated Show resolved Hide resolved
tests/core/filtering/conftest.py Outdated Show resolved Hide resolved
tests/core/filtering/test_contract_on_event_filtering.py Outdated Show resolved Hide resolved
tests/core/contracts/test_contract_buildTransaction.py Outdated Show resolved Hide resolved
removes web3(request) fixture from test_contract_buildTransaction.py
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@tmckenzie51 tmckenzie51 merged commit d3c23f8 into ethereum:master Oct 29, 2020
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.

2 participants