Skip to content

Commit 4caa207

Browse files
authored
add wrapper hook for pytest_runtest_protocol (microsoft#22243)
fixes microsoft#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 microsoft#22240
1 parent 44053a2 commit 4caa207

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pythonFiles/vscode_pytest/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def pytest_report_teststatus(report, config):
235235
}
236236

237237

238+
@pytest.hookimpl(hookwrapper=True, trylast=True)
238239
def pytest_runtest_protocol(item, nextitem):
239240
map_id_to_path[item.nodeid] = get_node_path(item)
240241
skipped = check_skipped_wrapper(item)
@@ -257,6 +258,7 @@ def pytest_runtest_protocol(item, nextitem):
257258
"success",
258259
collected_test if collected_test else None,
259260
)
261+
yield
260262

261263

262264
def check_skipped_wrapper(item):

0 commit comments

Comments
 (0)