Skip to content

Commit 06b1fbd

Browse files
committed
fix(fill): reference_spec fixture is required by fill, not by ver checker
This fixes up the previous commit that no longer includes the `spec_version_checker` plugin when executing `fill` or `execute` by removing it from their pytest-*ini files.
1 parent 7666d46 commit 06b1fbd

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/pytest_plugins/filler/filler.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
)
3434

3535
from ..shared.helpers import get_spec_format_for_item, labeled_format_parameter_set
36+
from ..spec_version_checker.spec_version_checker import get_ref_spec_from_module
3637

3738

3839
def default_output_directory() -> str:
@@ -601,6 +602,18 @@ def get_fixture_collection_scope(fixture_name, config):
601602
return "module"
602603

603604

605+
@pytest.fixture(autouse=True, scope="module")
606+
def reference_spec(request) -> None | ReferenceSpec:
607+
"""
608+
Pytest fixture that returns the reference spec defined in a module.
609+
610+
See `get_ref_spec_from_module`.
611+
"""
612+
if hasattr(request, "module"):
613+
return get_ref_spec_from_module(request.module)
614+
return None
615+
616+
604617
@pytest.fixture(scope=get_fixture_collection_scope)
605618
def fixture_collector(
606619
request: pytest.FixtureRequest,

src/pytest_plugins/spec_version_checker/spec_version_checker.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ def get_ref_spec_from_module(module: ModuleType) -> None | ReferenceSpec:
6262
return spec_obj
6363

6464

65-
@pytest.fixture(autouse=True, scope="module")
66-
def reference_spec(request) -> None | ReferenceSpec:
67-
"""
68-
Pytest fixture that returns the reference spec defined in a module.
69-
70-
See `get_ref_spec_from_module`.
71-
"""
72-
if hasattr(request, "module"):
73-
return get_ref_spec_from_module(request.module)
74-
return None
75-
76-
7765
def is_test_for_an_eip(input_string: str) -> bool:
7866
"""Return True if `input_string` contains an EIP number, i.e., eipNNNN."""
7967
pattern = re.compile(r".*eip\d{1,4}", re.IGNORECASE)

0 commit comments

Comments
 (0)