-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,19 @@ | |
import pytest | ||
from pytest import Metafunc | ||
|
||
from ethereum_test_forks import ( | ||
from ethereum_test_forks import ( # noqa: F401 | ||
Berlin, | ||
Byzantium, | ||
Cancun, | ||
Constantinople, | ||
Fork, | ||
ForkAttribute, | ||
Frontier, | ||
Homestead, | ||
Istanbul, | ||
London, | ||
Paris, | ||
Shanghai, | ||
forks_from_until, | ||
get_deployed_forks, | ||
get_forks, | ||
|
@@ -345,6 +355,12 @@ def get_validity_marker_args( | |
f"'{validity_marker_name}'. " | ||
f"List of valid forks: {', '.join(metafunc.config.fork_names)}" # type: ignore | ||
) | ||
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}'." | ||
) | ||
Comment on lines
+358
to
+363
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
return fork_name | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 |
||
@pytest.mark.parametrize( | ||
"create2_dest_already_in_state", | ||
(True, False), | ||
|
@@ -230,7 +230,7 @@ def test_dynamic_create2_selfdestruct_collision( | |
state_test(env=env, pre=pre, post=post, tx=tx) | ||
|
||
|
||
@pytest.mark.valid_from("Paris") | ||
@pytest.mark.valid_from("Cancun") | ||
@pytest.mark.parametrize( | ||
"selfdestruct_on_first_tx,recreate_on_first_tx", | ||
[ | ||
|
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 for
globals()[fork]