-
Notifications
You must be signed in to change notification settings - Fork 72
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
feature: use pytest to collect and execute test fillers #116
feature: use pytest to collect and execute test fillers #116
Conversation
I think this is a great idea! My only request is to try and keep the core dev who doesn't write python on a regular basis in the back of your mind as you develop the filler interface. One problem with the retesteth fillers IMO is that they became a DSL that only those who were regularly writing them could use / understand. One goal of this project should be for core devs to i) come in and fairly easily understand what is and isn't being tested and ii) write tests for a proposal if your team is busy with other things or their proposal isn't yet a priority. |
This breaks the tf command.
Additionally test that the contract call fails if call_exact_gas - 1 is specified instead of call_exact_gas.
This is to try and avoid confusion when running experimental fillers for upcoming protocol upgrades.
Also change the tf entry point to help the user get help with fill.
This removes the latest_fork_resolver. Deployed/developement forks are managed instead by an is_deployed() helper method to differentiate between deployed forks and forks under development. The user of ethereum_test_forks.helpers must now specify explicitly which forks are relevant. Currently, the main user of helpers is the src/pytest_plugins/forks plugin.
This change keeps a consistent interface with the get_forks()/get_deployed_forks()/get_development_forks() helpers
…cifying-fork-validity-for-tests pytest: add markers specifying test fork validity + framework cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
LGTM :D |
This PR (work in progress) ports the test-filling process implemented in the custom
tf
framework to the pytest framework. Pytest becomes responsible for collecting fillers (test functions) and managing their execution to generate fixtures from the spec defined within them.This is achieved by:
pytest_runtest_call()
hook.Pytest is a widely used Python framework and offers several advantages out-of-the-box:
pytest --collect-only
can be used to explore which fillers are available. Usepytest --collect-only -v
for a list with docstrings.tf
stops upon error).pytest -k warm_coinbase
orpytest -k Shanghai
).pytest --pdb
upon test filler error.Some demos and screenshots of pytest with execution-spec-tests can be found here (but note that these were generated from a different and now very out-of-date branch).
Quick start for working with this branch:
To do list for framework related tasks:
src/ethereum_test_filling_tool/filler.py
)tf
the entry point to run pytest.--latest-fork
command-line option - pytest: add latest fork parameter and exit gracefully upon an invalid fork danceratopz/execution-spec-tests#6fork
to a fixture.To do list for porting test fillers to pytest format: