Skip to content

Commit 2fdb77d

Browse files
committed
Addtional changes from last comments on PR ethereum#2007
1 parent 680b84c commit 2fdb77d

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

src/ethereum_test_fixtures/blockchain.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
)
1717

1818
import ethereum_rlp as eth_rlp
19+
import pytest
1920
from ethereum_types.numeric import Uint
2021
from pydantic import AliasChoices, Field, PlainSerializer, computed_field, model_validator
2122

@@ -586,3 +587,16 @@ class BlockchainEngineSyncFixture(BlockchainEngineFixture):
586587
"Tests that generate a blockchain test fixture for Engine API testing with client sync."
587588
)
588589
sync_payload: FixtureEngineNewPayload | None = None
590+
591+
@classmethod
592+
def discard_fixture_format_by_marks(
593+
cls,
594+
fork: Fork,
595+
markers: List[pytest.Mark],
596+
) -> bool:
597+
"""Discard the fixture format based on the provided markers."""
598+
marker_names = [m.name for m in markers]
599+
600+
if "verify_sync" not in marker_names:
601+
return True
602+
return False

src/ethereum_test_specs/blockchain.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,6 @@ def discard_fixture_format_by_marks(
446446
and "blockchain_test_engine_only" in marker_names
447447
):
448448
return True
449-
if fixture_format == BlockchainEngineSyncFixture and "verify_sync" not in marker_names:
450-
return True
451449
return False
452450

453451
def get_genesis_environment(self, fork: Fork) -> Environment:

src/ethereum_test_specs/state.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ class StateTest(BaseTest):
6161
f"A {fixture_format.format_name} generated from a state_test",
6262
)
6363
for fixture_format in BlockchainTest.supported_fixture_formats
64-
# Exclude sync fixtures from state tests - they don't make sense for state tests
65-
if not (
66-
(hasattr(fixture_format, "__name__") and "Sync" in fixture_format.__name__)
67-
or (hasattr(fixture_format, "format") and "Sync" in fixture_format.format.__name__)
68-
)
6964
]
7065
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
7166
LabeledExecuteFormat(

src/pytest_plugins/shared/execute_fill.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ def pytest_configure(config: pytest.Config):
132132
"addresses for static tests at fill time. Untagged tests are incompatible with "
133133
"dynamic address generation.",
134134
)
135+
config.addinivalue_line(
136+
"markers",
137+
"verify_sync: Marks a test to be run with `consume sync`, verifying blockchain "
138+
"engine tests and having hive clients sync after payload execution.",
139+
)
135140

136141

137142
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)