Skip to content

Commit 98db893

Browse files
committed
Remove attempt to only enable the fixture when --json-report is used
It was actually not enabling it at all ever.
1 parent 1c42d3a commit 98db893

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33

44
from hypothesis import settings
5-
from pytest import mark, fixture
5+
from pytest import mark
66

77
from array_api_tests import _array_module as xp
88
from array_api_tests._array_module import _UndefinedStub
@@ -126,6 +126,3 @@ def pytest_collection_modifyitems(config, items):
126126
ci_mark = next((m for m in markers if m.name == "ci"), None)
127127
if ci_mark is None:
128128
item.add_marker(mark.skip(reason="disabled via --ci"))
129-
130-
if config.getoption('--json-report'):
131-
fixture(autouse=True)(add_extra_json_metadata)

reporting.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from hypothesis.strategies import SearchStrategy
1010

11-
from pytest import mark
11+
from pytest import mark, fixture
1212
try:
1313
import pytest_jsonreport # noqa
1414
except ImportError:
@@ -42,8 +42,7 @@ def pytest_metadata(metadata):
4242
metadata['array_api_tests_module'] = xp.mod_name
4343
metadata['array_api_tests_version'] = __version__
4444

45-
# This is dynamically decorated as a fixture in pytest_collection_modifyitems
46-
# when --json-report is used.
45+
@fixture(autouse=True)
4746
def add_extra_json_metadata(request, json_metadata):
4847
"""
4948
Additional per-test metadata for --json-report

0 commit comments

Comments
 (0)