Coverage for lintro / tools / implementations / pytest / pytest_output_processor.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-04-03 18:53 +0000

1"""Output processing functions for pytest tool. 

2 

3This module contains output parsing, summary extraction, performance warnings, 

4and flaky test detection logic extracted from PytestTool to improve 

5maintainability and reduce file size. 

6 

7All functions are re-exported from submodules for backwards compatibility. 

8""" 

9 

10from __future__ import annotations 

11 

12from lintro.tools.implementations.pytest.coverage_processor import ( 

13 extract_coverage_report, 

14 parse_coverage_summary, 

15) 

16from lintro.tools.implementations.pytest.formatters import ( 

17 _extract_brief_message, 

18 build_output_with_failures, 

19 format_pytest_issue, 

20 format_pytest_issues_table, 

21 process_test_summary, 

22) 

23from lintro.tools.implementations.pytest.output_parsers import ( 

24 parse_pytest_output_with_fallback, 

25) 

26from lintro.tools.implementations.pytest.test_analytics import ( 

27 PYTEST_FLAKY_FAILURE_RATE, 

28 PYTEST_FLAKY_MIN_RUNS, 

29 PYTEST_SLOW_TEST_THRESHOLD, 

30 PYTEST_TOTAL_TIME_WARNING, 

31 check_total_time_warning, 

32 detect_and_log_flaky_tests, 

33 detect_and_log_slow_tests, 

34) 

35 

36__all__ = [ 

37 # Constants 

38 "PYTEST_FLAKY_FAILURE_RATE", 

39 "PYTEST_FLAKY_MIN_RUNS", 

40 "PYTEST_SLOW_TEST_THRESHOLD", 

41 "PYTEST_TOTAL_TIME_WARNING", 

42 # Output parsing 

43 "parse_pytest_output_with_fallback", 

44 # Test analytics 

45 "check_total_time_warning", 

46 "detect_and_log_flaky_tests", 

47 "detect_and_log_slow_tests", 

48 # Coverage processing 

49 "extract_coverage_report", 

50 "parse_coverage_summary", 

51 # Formatters 

52 "_extract_brief_message", 

53 "build_output_with_failures", 

54 "format_pytest_issue", 

55 "format_pytest_issues_table", 

56 "process_test_summary", 

57]