Skip to content

Move with_custom_context to tests/infra/context and add tests for it#4776

Open
kysre wants to merge 3 commits intoethereum:masterfrom
kysre:add-with-custom-state
Open

Move with_custom_context to tests/infra/context and add tests for it#4776
kysre wants to merge 3 commits intoethereum:masterfrom
kysre:add-with-custom-state

Conversation

@kysre
Copy link
Copy Markdown

@kysre kysre commented Dec 5, 2025

In this PR with_custom_context decorator in tests/core/pyspec/eth2spec/test/context.py is moved to tests/infra/context.py. Also some tests for this decorator is added in tests/infra/test_with_custom_context.py

Fixes #4669

@kysre kysre changed the title Move with_custom_context to tests/infra/context and add tests for with_custom_context Move with_custom_context to tests/infra/context and add tests for it Dec 5, 2025
@leolara
Copy link
Copy Markdown
Member

leolara commented Jan 7, 2026

It doesn't pass all the checks

state = _prepare_state(balances_fn, threshold_fn, spec, phases)
_custom_state_cache_dict[key] = state.get_backing()

# Wrap cached immutable backing with a fresh view
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was important in this comment, that it is reason we don't need to copy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests with_custom_state

2 participants