From 6eab325597252d7aa563a9e7c85b02836a0dbaab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parodi=2C=20Eugenio=20=F0=9F=8C=B6?= Date: Fri, 2 Jan 2026 16:10:10 +0000 Subject: [PATCH] chore: hack into verbosity --- .../ttkode/ttkode/plugins/_030/pytest_glue.py | 26 +++++++++++++++++++ .../plugins/_030/scripts/_main_tests.py | 3 +++ 2 files changed, 29 insertions(+) diff --git a/apps/ttkode/ttkode/plugins/_030/pytest_glue.py b/apps/ttkode/ttkode/plugins/_030/pytest_glue.py index 58e1f299..393bdc71 100644 --- a/apps/ttkode/ttkode/plugins/_030/pytest_glue.py +++ b/apps/ttkode/ttkode/plugins/_030/pytest_glue.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import sys import json import pytest @@ -28,7 +29,18 @@ from typing import Dict, Any from _030.pytest_data import TestResult +class _Highlighter(): + _highlight = None + +class _Dummy(): + _tw = _Highlighter() + class ResultCollector_Logreport: + def pytest_configure(self, config:pytest.Config): + config.pluginmanager.register(_Dummy(), "terminalreporter") + # config.option.verbose = 2 + + def pytest_runtest_logreport(self, report:pytest.TestReport) -> None: if report.when == "call": result = TestResult( @@ -40,6 +52,20 @@ class ResultCollector_Logreport: location = report.location ) + # Print detailed output for failed tests (like terminal plugin does) + # if report.failed and report.longrepr: + # print(f"\n{'='*70}") + # print(f"FAILED: {report.nodeid}") + # print(f"{'='*70}") + # print(report.longrepr) + # print() + + # # Print captured output sections + # if report.sections: + # for section_name, section_content in report.sections: + # print(f"\n{'-'*70} {section_name} {'-'*70}") + # print(section_content) + # print('REPORT: -------') # print(report) # print('SECTIONS: -------') diff --git a/apps/ttkode/ttkode/plugins/_030/scripts/_main_tests.py b/apps/ttkode/ttkode/plugins/_030/scripts/_main_tests.py index 50911cb0..20bc34a8 100644 --- a/apps/ttkode/ttkode/plugins/_030/scripts/_main_tests.py +++ b/apps/ttkode/ttkode/plugins/_030/scripts/_main_tests.py @@ -26,6 +26,9 @@ def main() -> None: dirname = sys.argv[1] test_path = sys.argv[2] + # dirname = "apps/ttkode/ttkode/plugins/_030" + # test_path = "tests/pytest/test_005_tree.py::test_tree_show_hide" + sys.path.append(f'{dirname}/..') from _030.pytest_glue import ResultCollector_Logreport