Skip to content

Commit

Permalink
Fix pytest-dev/pytest#4562 related deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
elchupanebrej committed Jun 26, 2023
1 parent 5039b32 commit 71d51e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pytest_bdd/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 71d51e5

Please sign in to comment.