Skip to content

Commit 6274c3c

Browse files
committed
Also call pytest_runtest_log{start,finish} hooks
Otherwise some reporting is missing. In particular, pytest 6 moves some output to these hooks.
1 parent 6c50383 commit 6274c3c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/pytest_forked/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ def pytest_load_initial_conftests(early_config, parser, args):
4141
@pytest.hookimpl(tryfirst=True)
4242
def pytest_runtest_protocol(item):
4343
if item.config.getvalue("forked") or item.get_closest_marker("forked"):
44+
ihook = item.ihook
45+
ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location)
4446
reports = forked_run_report(item)
4547
for rep in reports:
46-
item.ihook.pytest_runtest_logreport(report=rep)
48+
ihook.pytest_runtest_logreport(report=rep)
49+
ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location)
4750
return True
4851

4952

testing/test_xfail_behavior.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_xfail(is_crashing, is_strict, testdir):
5353
session_start_title = '*==== test session starts ====*'
5454
loaded_pytest_plugins = 'plugins: forked*'
5555
collected_tests_num = 'collected 1 item'
56-
expected_progress = 'test_xfail.py {expected_letter!s}'.format(**locals())
56+
expected_progress = 'test_xfail.py {expected_letter!s}*'.format(**locals())
5757
failures_title = '*==== FAILURES ====*'
5858
failures_test_name = '*____ test_function ____*'
5959
failures_test_reason = '[XPASS(strict)] The process gets terminated'

0 commit comments

Comments
 (0)