Skip to content

Adding a New TestΒΆ

All test cases are located underneath the tests directory, which are then organized by fork. Each fork contains sub-directories containing test sub-categories.

πŸ“ execution-specs/
β”œβ”€β•΄πŸ“ tests/
|   β”œβ”€β”€ πŸ“„ __init__.py
β”‚   β”œβ”€β”€ πŸ“ cancun/
|   |    β”œβ”€β”€ πŸ“„ __init__.py
β”‚   |    └── πŸ“ eip4844_blobs/
|   |        β”œβ”€β”€ πŸ“„ __init__.py
|   |        β”œβ”€β”€ πŸ“„ test_blobhash_opcode.py
|   |        β”œβ”€β”€ πŸ“„ test_excess_blob_gas.py
|   |        └── πŸ“„ ...
|   β”œβ”€β”€ πŸ“ shanghai
|   |    β”œβ”€β”€ πŸ“ eip3651_warm_coinbase
|   |    |   β”œβ”€β”€ πŸ“„ __init__.py
|   |    |   └── πŸ“„ test_warm_coinbase.py
|   |    β”œβ”€β”€ πŸ“ eip3855_push0
|   |    |   β”œβ”€β”€ πŸ“„ __init__.py
|   |    |   └── πŸ“„ test_push0.py
|   |    β”œβ”€β”€ πŸ“...
|   |    ...
β”‚   └── πŸ“ ...

Each category/sub-directory may have multiple Python test modules (*.py) which in turn may contain many test functions. The test functions themselves are always parametrized by fork (by the framework).

A new test can be added by either:

  • Adding a new test_ python function to an existing file in any of the existing category subdirectories within tests.
  • Creating a new source file in an existing category, and populating it with the new test function(s).
  • Creating an entirely new category by adding a subdirectory in tests with the appropriate source files and test functions.