-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat(pytest/plugins): Fork covariant parametrize #1019
base: main
Are you sure you want to change the base?
Conversation
To give an example of the usefulness of this, when parametrizing the valid blob tests using this feature, on Cancun with vanilla 4844 we get the 87 test cases (not showing complete list here):
On prague with EIP-7691 and EIP-7762 enabled we get 338 test cases (again not showing complete list here):
And both are generated using the same test function and same fork-covariant test case generator, but the different values returned from |
🗒️ Description
This PR introduces a new decorator called
fork_covariant_parametrize
.The goal of the decorator is to be able to dynamically parametrize a test depending on which fork the tests are being filled.
This is done using a custom function that is passed to the decorator, which will then be executed once per fork that the test is being filled with.
It allows to dynamically create a different amount of test cases per fork (Useful for EIP-4844 tests which are being modified by fork now).
Example
In this example, the test will be parametrized with the values
[1, 2]
and[3, 4]
for the Paris fork, with values1
and3
being assigned totest_parameter
and2
and4
being assigned totest_parameter_2
.For the Shanghai fork, the test will be parametrized with the values
[4, 5]
,[5, 6]
, and[6, 7]
.Therefore, more test cases will be generated for the Shanghai fork.
🔗 Related Issues
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.