Move with_custom_state to infra & add tests#4859
Open
galke7 wants to merge 1 commit intoethereum:masterfrom
Open
Move with_custom_state to infra & add tests#4859galke7 wants to merge 1 commit intoethereum:masterfrom
with_custom_state to infra & add tests#4859galke7 wants to merge 1 commit intoethereum:masterfrom
Conversation
leolara
reviewed
Jan 25, 2026
tests/infra/test_custom_state.py
Outdated
|
|
||
| # --- The Test Case --- | ||
|
|
||
| def test_custom_state_decorator(): |
Member
There was a problem hiding this comment.
We should more test cases, specially that test both parameters with different values. Perhaps it is better if the test function returns what you are trying to assert over.
f768588 to
69c32ce
Compare
Author
|
Thanks for the guidance.
|
69c32ce to
dbce783
Compare
with_custom_state to infra & add tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the testing infrastructure by moving the
with_custom_statedecorator from the core spec context (tests/core/pyspec/eth2spec/test/context.py) to the infrastructure context (tests/infra/context.py).Why this change is necessary:
The
with_custom_statefunction is a testing utility, not a core specification rule. Keeping it in the core module risked creating circular dependencies as the test suite grows. Moving it totests/infraensures better modularity and allows other test modules to import it without conflict.Additionally, this PR adds a new test file
tests/infra/test_custom_state.pyto verify that the decorator correctly injects custom state balances and parameters, ensuring the utility works as expected in isolation.Checklist
make lintto check formattingmake testto check testsRelations
Fixes #4669