Skip to content

Commit

Permalink
add wrapper hook for pytest_runtest_protocol (#22243)
Browse files Browse the repository at this point in the history
fixes #22232. From
pytest-dev/pytest#11509, learned that
some pytest hooks are meant to be unique and only one will be called per
run. If multiple plugins are at play then another plugin the user has
might override our plugin. Added the hookwrapper so our is always run.
Same as #22240
  • Loading branch information
eleanorjboyd authored Oct 17, 2023
1 parent 44053a2 commit 4caa207
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pythonFiles/vscode_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def pytest_report_teststatus(report, config):
}


@pytest.hookimpl(hookwrapper=True, trylast=True)
def pytest_runtest_protocol(item, nextitem):
map_id_to_path[item.nodeid] = get_node_path(item)
skipped = check_skipped_wrapper(item)
Expand All @@ -257,6 +258,7 @@ def pytest_runtest_protocol(item, nextitem):
"success",
collected_test if collected_test else None,
)
yield


def check_skipped_wrapper(item):
Expand Down

0 comments on commit 4caa207

Please sign in to comment.