Skip to content

Commit 44053a2

Browse files
authored
add hookwrappers to pytest plugin to ensure run (microsoft#22240)
fixes microsoft#22232. From [this discussion](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.
1 parent 754f8ef commit 44053a2

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
@@ -183,6 +183,7 @@ class testRunResultDict(Dict[str, Dict[str, TestOutcome]]):
183183
tests: Dict[str, TestOutcome]
184184

185185

186+
@pytest.hookimpl(hookwrapper=True, trylast=True)
186187
def pytest_report_teststatus(report, config):
187188
"""
188189
A pytest hook that is called when a test is called. It is called 3 times per test,
@@ -223,6 +224,7 @@ def pytest_report_teststatus(report, config):
223224
"success",
224225
collected_test if collected_test else None,
225226
)
227+
yield
226228

227229

228230
ERROR_MESSAGE_CONST = {

0 commit comments

Comments
 (0)