From da212aa6f8de78feeedea339ac85ebf7ffbeddd1 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Wed, 27 Aug 2025 19:21:15 +0200 Subject: [PATCH] Update conftest.py --- conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 6fe0aed..3a39875 100644 --- a/conftest.py +++ b/conftest.py @@ -103,8 +103,10 @@ def pytest_runtest_makereport(item, call): runtime_params.append(entry) -def pytest_configure(config): - sys.stdout = open("outputs/test-prints.log", "a") +def pytest_runtest_logreport(report): + if report.when == "call" and report.capstdout: + with open("outputs/test-prints.log", "a") as f: + f.write(report.capstdout) def pytest_sessionfinish(session, exitstatus): os.makedirs("markdown", exist_ok=True)