Useful Pytest Options¶
The EEST commands to run tests are customizations to the pytest framework, which provides many helpful options for test selection, parallel execution, report output and debugging. This section provides the most relevant options, a full overview is available in the pytest docs.
Fixture Inputs (Consume Commands)¶
See Consume Cache and Fixture Inputs.
Dry-Run¶
List collected tests, -q restricts output to test IDs only:
In ./hive standalone mode, this can be achieved via EEST's --sim.limit "collectonly" prefix.
Output Control¶
-v- verbose output.-vv- more verbose output.-s- print stdout to the terminal during execution (don't capture it).--eest-log-level=<LOG_LEVEL>- write logs during test (helpful in combination with-s).
Report Generation¶
JSON, HTML and XML reports can be generated with:
Test Case Selection Using Test IDs¶
In addition to Hive's regex-based --sim.limit option, running in dev mode supports pytest's -k syntax:
uv run consume rlp -k "test_chainid and fork_London"
uv run consume engine -k "eip1559 or eip4844" -m cancun
Use --collect-only -q to see which tests would run without executing them:
Test Case Selection using Marks¶
Select tests based on pytest marks.
Run only state tests:
Run blockchain tests for specific fork:
Combine marks with keyword filtering:
Mark Availability
Not all test marks are available with consume commands. Fork and test type marks work reliably.
Parallel Execution¶
Speed up test execution by running tests in parallel using pytest-xdist.
Auto-detect CPU count:
Specify worker count:
Dropping in the Python Debugger¶
Dropping into the Python debugger can be helpful to inspect EEST simulator state or ssh to a client container. Adding the --pdb option will drop into Python debugger upon test failure, -x tells pytest to exit after the first fail:
PDB Cheatsheet¶
- u → up the stack
- d → down the stack
- l → list lines around current position
- ll → list entire function body
- p → print expression
- pp → pretty-print expression
Sometimes pp is not enough and it's worth importing rich (import rich) in pdb and doing a rich.print(obj).
Early Exit Options¶
Stop after first failure:
Stop after N failures:
Performance and Timing¶
Show slowest tests:
Show all test durations:
Timeout control (per test):
Print relevant test stage timings such as client start-up, payload response time (consume only):