Browse Source

chore: hack into verbosity

pull/588/head
Parodi, Eugenio 🌶 2 months ago
parent
commit
6eab325597
  1. 26
      apps/ttkode/ttkode/plugins/_030/pytest_glue.py
  2. 3
      apps/ttkode/ttkode/plugins/_030/scripts/_main_tests.py

26
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: -------')

3
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

Loading…
Cancel
Save