Skip to content

fix(cli): add pytest EIP markers for valid_from tests#2701

Open
shrirajpawar4 wants to merge 2 commits intoethereum:forks/amsterdamfrom
shrirajpawar4:feat/add-eip-marker
Open

fix(cli): add pytest EIP markers for valid_from tests#2701
shrirajpawar4 wants to merge 2 commits intoethereum:forks/amsterdamfrom
shrirajpawar4:feat/add-eip-marker

Conversation

@shrirajpawar4
Copy link
Copy Markdown

🗒️ Description

Auto-add plain pytest EIP#### markers for tests that are explicitly enabled by valid_from("EIP####").

This makes EIP-scoped selection work as requested in #2675, so commands like:

uv run fill --clean --fork=Amsterdam -m EIP7928

can select tests that are marked valid from a given EIP without relying on ad hoc -k expressions.

This change is intentionally narrow:

  • It promotes explicit valid_from("EIP####") markers into plain pytest markers during collection.
  • It does not treat negative selectors such as valid_before("EIP####") as matching -m EIP####.
  • It registers known EIP#### markers so they are valid pytest markers.

It also adds targeted regression tests covering:

  • function-level valid_from("EIP####")
  • param-level valid_from("EIP####")
  • the negative case where valid_before("EIP####") must not match -m EIP####

🔗 Related Issues or PRs

Fixes #2675.

✅ Checklist

Verification

Manual behavior check against a real test file:

  uv run pytest \
    -c packages/testing/src/execution_testing/cli/pytest_commands/pytest_ini_files/pytest-fill.ini \
    tests/frontier/validation/test_header.py \
    --until=Amsterdam \
    --collect-only -q -m EIP7928

Observed result:

  • collected test_gas_limit_below_minimum[...,gas_limit_5000_1]
  • did not collect ...,gas_limit_5000_0

This confirms -m EIP7928 selects the valid_from("EIP7928") case and not the valid_before("EIP7928") case.

Targeted regression tests:

  uv run pytest \
    packages/testing/src/execution_testing/cli/pytest_commands/plugins/forks/tests/test_markers.py \
    -q \
    -k 'function_level_valid_from_eip_is_selectable_by_mark or param_level_valid_from_eip_is_selectable_by_mark or negative_eip_selectors_do_not_add_eip_markers'

Observed result:

3 passed

Cute Animal Picture

image

@shrirajpawar4
Copy link
Copy Markdown
Author

@fselmo do take a look at PR whenever you can sir

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 EIP marker for better DevEx

1 participant