-
Notifications
You must be signed in to change notification settings - Fork 655
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
Make block_number
configurable in genesis header again
#2063
base: main
Are you sure you want to change the base?
Conversation
}, False) | ||
) | ||
) | ||
def test_fill_header_params_from_parent(custom_header_params, null_parent, |
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.
The test cases look good here. We do try to avoid conditionals in our tests and instead split each test case out into their own test. With conditionals, it can be hard to read what test case ends where and to know which conditional is causing the test to pass over another without debugging the test, etc.
If we can split each test case out into its own test, with an explicit title of the thing it is testing, I think that would be ideal. We can probably factor out the parametrized test cases into a list and pass them into each test if they end up sharing similar info too... something like:
CUSTOM_HEADER_TEST_DATA = (
{
'gas_limit': 1,
'difficulty': 10,
...
},
{ ... },
{ ... },
)
@pytest.mark.parametrize('custom_header_params', CUSTOM_HEADER_TEST_DATA)
def test_case_1(custom_header_params):
...
@pytest.mark.parametrize('custom_header_params', CUSTOM_HEADER_TEST_DATA)
def test_case_2(custom_header_params):
...
Thoughts?
Thanks for working this @catoenm! This looks good to me. I just left one refactor comment on the tests and then I can add a newsfragment and merge it 👌 |
What was wrong?
#2044
How was it fixed?
Fixed according to issue log.