Skip to content

Commit 2201c2e

Browse files
authored
chore(tests): add conftests to zkevm & bls subdirs to apply zkevm marker (#1534)
* chore(tests): add conftests to zkevm & bls subdirs to apply zkevm marker * docs: update changelog
1 parent c2cf2a2 commit 2201c2e

File tree

6 files changed

+22
-3
lines changed

6 files changed

+22
-3
lines changed

docs/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Test fixtures for use by clients are available for each release on the [Github r
2222

2323
### 🧪 Test Cases
2424

25+
- 🔀 Automatically apply the `zkevm` marker to all tests under `./tests/zkevm/` and `./tests/prague/eip2537_bls_12_381_precompiles/` via conftest configuration ([#1534](https://github.com/ethereum/execution-spec-tests/pull/1534)).
26+
2527
## [v4.4.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v4.4.0) - 2025-04-29
2628

2729
### 💥 Breaking Change

tests/prague/eip2537_bls_12_381_precompiles/conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Shared pytest definitions local to EIP-2537 tests."""
22

3+
from pathlib import Path
34
from typing import SupportsBytes
45

56
import pytest
@@ -12,6 +13,13 @@
1213
from .spec import GAS_CALCULATION_FUNCTION_MAP
1314

1415

16+
def pytest_collection_modifyitems(config, items):
17+
"""Add the `zkevm` marker to all tests in `./tests/prague/eip2537_bls_12_381_precompiles`."""
18+
for item in items:
19+
if Path(__file__).parent in Path(item.fspath).parents:
20+
item.add_marker(pytest.mark.zkevm)
21+
22+
1523
@pytest.fixture
1624
def vector_gas_value() -> int | None:
1725
"""

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_g1add.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
pytestmark = [
1919
pytest.mark.valid_from("Prague"),
2020
pytest.mark.parametrize("precompile_address", [Spec.G1ADD], ids=[""]),
21-
pytest.mark.zkevm,
2221
]
2322

2423

tests/zkevm/conftest.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Pytest configuration for zkEVM tests."""
2+
3+
from pathlib import Path
4+
5+
import pytest
6+
7+
8+
def pytest_collection_modifyitems(config, items):
9+
"""Add the `zkevm` marker to all tests under `./tests/zkevm`."""
10+
for item in items:
11+
if Path(__file__).parent in Path(item.fspath).parents:
12+
item.add_marker(pytest.mark.zkevm)

tests/zkevm/test_worst_bytecode.py

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
XOR_TABLE = [Hash(i).sha256() for i in range(XOR_TABLE_SIZE)]
3636

3737

38-
@pytest.mark.zkevm
3938
@pytest.mark.parametrize(
4039
"opcode",
4140
[

tests/zkevm/test_worst_compute.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
KECCAK_RATE = 136
2121

2222

23-
@pytest.mark.zkevm
2423
@pytest.mark.valid_from("Cancun")
2524
@pytest.mark.parametrize(
2625
"gas_limit",

0 commit comments

Comments
 (0)