From 71d51e5eda971d56d3d2cdbccf52f463a7d28125 Mon Sep 17 00:00:00 2001 From: Kostiantyn Goloveshko Date: Wed, 2 Nov 2022 23:11:03 +0200 Subject: [PATCH] Fix https://github.com/pytest-dev/pytest/issues/4562 related deprecations --- pytest_bdd/reporting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pytest_bdd/reporting.py b/pytest_bdd/reporting.py index 6784932d..8272df22 100644 --- a/pytest_bdd/reporting.py +++ b/pytest_bdd/reporting.py @@ -130,7 +130,7 @@ class ScenarioReporterPlugin: def __init__(self): self.current_report = None - @pytest.mark.hookwrapper + @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(self, item: Item, call: CallInfo): outcome = yield if call.when != "setup": @@ -142,12 +142,12 @@ def pytest_runtest_makereport(self, item: Item, call: CallInfo): rep.scenario = scenario_report.serialize() rep.item = {"name": item.name} - @pytest.mark.tryfirst + @pytest.hookimpl(tryfirst=True) def pytest_bdd_before_scenario(self, request: FixtureRequest, feature: Feature, scenario: Scenario) -> None: """Create scenario report for the item.""" self.current_report = ScenarioReport(feature=feature, scenario=scenario) # type: ignore[call-arg] - @pytest.mark.tryfirst + @pytest.hookimpl(tryfirst=True) def pytest_bdd_step_error( self, request: FixtureRequest, @@ -161,14 +161,14 @@ def pytest_bdd_step_error( """Finalize the step report as failed.""" self.current_report.fail() - @pytest.mark.tryfirst + @pytest.hookimpl(tryfirst=True) def pytest_bdd_before_step( self, request: FixtureRequest, feature: Feature, scenario: Scenario, step: Step, step_func: Callable ) -> None: """Store step start time.""" self.current_report.add_step_report(StepReport(step=step)) - @pytest.mark.tryfirst + @pytest.hookimpl(tryfirst=True) def pytest_bdd_after_step( self, request: FixtureRequest,