Skip to content

Commit 00889e5

Browse files
committed
Addtional changes from last comments on PR #2007
- Add marker to `pytest_configure` as an official marker and to silence warnings. - Define a `BlockchainEngineSyncFixture.discard_fixture_format_by_marks` and specify `verify_sync` marker presence only for `BlockchainEngineSyncFixture`.
1 parent 680b84c commit 00889e5

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/ethereum_test_fixtures/blockchain.py

Lines changed: 11 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,13 @@ 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+
return "verify_sync" not in marker_names

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/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)