-
Notifications
You must be signed in to change notification settings - Fork 122
feat(pytest,tests): tests added by fork introduced #423
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
base: main
Are you sure you want to change the base?
feat(pytest,tests): tests added by fork introduced #423
Conversation
fork_folder = metafunc.module.__name__.split(".")[1].capitalize() | ||
if globals()[fork_name] < globals()[fork_folder]: | ||
pytest.fail( | ||
f"Incorrect usage of '{validity_marker_name}'. The validity marker fork " | ||
f"'{fork_name}' must be greater than or equal to the test folder fork '{fork_folder}'." | ||
) |
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.
Validity marker check. Note this required us to move some existing tests or change the fork name.
@@ -39,7 +39,7 @@ def env(): # noqa: D103 | |||
) | |||
|
|||
|
|||
@pytest.mark.valid_from("Paris") | |||
@pytest.mark.valid_from("Cancun") |
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.
Note this is still in Draft. I changed these to Cancun for now such that these tests pass the validity marker check.
What do we do in cases like this? To me if a test is valid before the fork where the eip or feature is introduced, it should not exist within that fork folder.
Are they specific to eip6780 or selfdestruct? If its the latter, I think we should move them to Homestead (where selfdestruct was introduced, well renamed from SUICIDE -> SELFDESTRUCT
). Then mark them valid from the forks as is currently without the change.
c827ddb
to
d22bdf1
Compare
d22bdf1
to
f2ca3ad
Compare
from ethereum_test_forks import ( # noqa: F401 | ||
Berlin, | ||
Byzantium, | ||
Cancun, | ||
Constantinople, |
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.
I would like to find a better way to this, but its needed forglobals()[fork]
up |
🗒️ Description
In the past we have had confusion on where tests should be added regarding the folder structure.
This PR aims to:
valid_from
a fork < the fork folder a test lies within.Primary additions currently
valid_from
pytest marker is utilized correctly.valid_from
fork must be greater than or equal to the fork folder the test is added.Please note comments added below for further discussion.
🔗 Related Issues
Requires #418 for the yul test to compile from Frontier.
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.