Skip to content

Commit

Permalink
Fix for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Oct 17, 2024
1 parent 3070a68 commit 512ad53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytest_reportportal/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,15 @@ def report_fixture(request: FixtureRequest, name: str, error_msg: str) -> None:
reporter.finish_nested_step(item_id, timestamp(), 'FAILED')


# no 'fixturedef' type for backward compatibility for older pytest versions
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef, request: FixtureRequest) -> None:
yield from report_fixture(
request, f'{fixturedef.scope} fixture setup: {fixturedef.argname}',
f'{fixturedef.scope} fixture setup failed: {fixturedef.argname}')


# no 'fixturedef' type for backward compatibility for older pytest versions
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_post_finalizer(fixturedef, request: FixtureRequest) -> None:
yield from report_fixture(
Expand Down

0 comments on commit 512ad53

Please sign in to comment.