Getting Started: Filling Tests¶
This guide describes how to get started with fill
and commonly-used command-line options.
-
Explore test cases via
--collect-only
and search for test cases that combinePUSH0
andDELEGATECALL
in the EVM functionality introduced in the Shanghai hard fork:uv run fill --collect-only -k "push0 and delegatecall" tests/shanghai/
The
fill
command is based onpytest
. The above command uses the optional pytest arguments:--collect-only
only collect test cases; don't execute them.-k <expression>
filter test cases by their test case ID based on the given expression.tests/shanghai
the directory containing the test cases (tellsfill
to only discover test cases in this directory; default:tests/
).
Expected console output:
-
Fill
state_test
fixtures for these test cases:uv run fill -k "push0 and delegatecall" tests/shanghai/ -m state_test -v
where:
-m state_test
only fills test cases marked as astate_test
(see all available markers viauv run fill --markers
).-v
enables verbose output.
Expected console output:
-
Verify the generated fixtures:
a. Check the corresponding fixture file has been generated:
head fixtures/state_tests/shanghai/eip3855_push0/push0/push0_contract_during_call_contexts.json
b. Open the generated HTML test using the link provided at the bottom of the console output. This is written to the output directory at:
./fixtures/.meta/report_fill.html
Next Steps¶
- Learn useful command-line flags.
- Execute tests for features under development via the
--fork
flag. - Optional: Configure VS Code to auto-format Python code and execute tests within VS Code.
- Implement a new test case, see Writing Tests.