Skip to content

Commit 581d767

Browse files
committed
Fix deprecated pytest mark
mark.optionalhook has been deprecated (https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers)
1 parent d264bad commit 581d767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reporting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from hypothesis.strategies import SearchStrategy
1212

13-
from pytest import mark, fixture
13+
from pytest import hookimpl, fixture
1414
try:
1515
import pytest_jsonreport # noqa
1616
except ImportError:
@@ -44,7 +44,7 @@ def to_json_serializable(o):
4444

4545
return o
4646

47-
@mark.optionalhook
47+
@hookimpl(optionalhook=True)
4848
def pytest_metadata(metadata):
4949
"""
5050
Additional global metadata for --json-report.
@@ -91,7 +91,7 @@ def finalizer():
9191

9292
request.addfinalizer(finalizer)
9393

94-
@mark.optionalhook
94+
@hookimpl(optionalhook=True)
9595
def pytest_json_modifyreport(json_report):
9696
# Deduplicate warnings. These duplicate warnings can cause the file size
9797
# to become huge. For instance, a warning from np.bool which is emitted

0 commit comments

Comments
 (0)