Orchestrata Ultimate › Tests › Reference › scripts › test_code_review_tool

Tests reference — tests/scripts/test_code_review_tool.py

Module of tests/scripts, split out because the directory page would be too large.

Prose pending.

tests/scripts/test_code_review_tool.py

source · 76 tests · 1724 lines

Tests for scripts/code-review.py — the unified code review tool.

Kind Name Line Description
function test_code_issue_defaults 160
function test_review_report_add_issue_deduplicates 168
function test_review_report_add_issue_tracks_summaries 185
function test_base_checker_check_file_reads_source_and_delegates 219
function test_base_checker_check_file_read_error_adds_issue 230
function test_ruff_checker_detects_unused_import 245
function test_ruff_checker_fix_flag_modifies_file 260
function test_ruff_checker_clean_file_no_issues 272
function test_ruff_checker_file_not_found_when_ruff_missing_from_path 311 ADR-0089: with a ruff-less interpreter, the -m ruff child exits
function test_ruff_checker_interpreter_not_found 322 ADR-0089: a configured interpreter path that does not exist is a real
function test_ruff_checker_nonzero_exit_with_no_output_is_reported 336 A spawned child that exits non-zero with no output (the SIGKILL/OOM
function test_tool_did_not_run_is_error_severity 368 Every "the checker never produced a verdict" code must be ERROR.
function test_missing_ruff_fails_the_run 396 End to end: with ruff genuinely absent from the interpreter, the
function test_parse_ruff_output_skips_malformed_lines 415
function test_map_ruff_severity_all_prefixes 437
function test_is_ruff_fixable_all_branches 447
function test_ruff_format_checker_reformats_file 464
function test_ruff_format_checker_syntax_error_reports_issue 477
function test_ruff_format_checker_file_not_found 485 ADR-0089: with a ruff-less interpreter, the -m ruff format child
function test_mypy_checker_detects_type_error 501
function test_mypy_checker_clean_file_no_issues 515
function test_mypy_checker_file_not_found 527 MyPyChecker resolves mypy via [sys.executable, "-m", "mypy"] by
function test_parse_mypy_output_branches 542
function test_style_checker_formatting_reports_tabs_only 568
function test_style_checker_docstrings 586
function test_style_checker_type_hints 621
function test_style_checker_naming_conventions 661
function test_style_checker_complexity_function_class_and_args 711
function test_style_checker_test_isolation_flush_and_delete 727
function test_style_checker_test_isolation_non_test_file_skipped 768
function test_style_checker_code_patterns_bare_except_and_mutable_default 783
function test_reviewing_code_never_imports_tree_sitter 819 No import of tree_sitter may happen anywhere in a review run.
function test_style_checker_syntax_error 880
function test_checklist_checker_class_too_many_methods 893
function test_checklist_checker_method_self_access 906
function test_checklist_checker_abstract_classes 928
function test_checklist_checker_flags_a_bare_pass_in_a_test 955
function test_checklist_checker_syntax_error_silently_ignored 971
function test_traceability_checker_path_skips 992
function test_traceability_checker_missing_traces_reports_class_and_method 1012
function test_traceability_checker_class_kind_skips 1025
function test_traceability_checker_present_traces_no_issues 1064
function test_traceability_checker_method_skips_property_and_pydantic_decorator 1087
function test_traceability_checker_pydantic_class_is_fully_exempt 1124
function test_traceability_checker_syntax_error_returns_silently 1148
function test_connection_string_checker_skips_tests_dir 1161
function test_connection_string_checker_syntax_error 1169
function test_connection_string_checker_full_scan 1177
function test_find_python_files 1243
function test_filter_issues_by_severity 1260
function test_output_text_stdout_and_file 1325
function test_output_text_without_fixable_issues_skips_quick_fixes 1342
function test_output_json_stdout_and_file 1359
function test_output_markdown_stdout_and_file 1376
function test_output_markdown_without_fixable_issues_skips_quick_fixes 1390
function test_run_diagnostics_reports_findings_on_marker_output 1425
function test_run_diagnostics_no_findings_on_clean_output 1438
function test_run_diagnostics_handles_subprocess_exception 1446
function test_main_no_files_found 1464
function test_main_max_files_limits_processing 1473
function test_main_basic_run_writes_dated_report_and_returns_zero 1487
function test_main_error_severity_returns_one 1502
function test_main_output_flag_writes_extra_file 1514
function test_main_stdout_flag_prints_report 1525
function test_main_json_format 1534
function test_main_markdown_format 1557
function test_main_fix_flag_modifies_file 1577
function test_main_format_code_flag_reformats_file 1587
function test_main_diagnostics_flag_invokes_run_diagnostics 1597
function test_main_wires_repo_gates 1608 main() must actually invoke the banned-dependency and prolog-boundary
function test_load_banned_libraries_reads_names_skips_comments 1666
function test_load_banned_libraries_absent_returns_empty 1678
function test_banned_dependency_flagged_in_pyproject 1682
function test_banned_name_in_comment_not_flagged 1696
function test_clean_pyproject_not_flagged 1708
function test_banned_dependency_with_extras_flagged 1716 A banned dep declared with an extras marker (pkg[extra]>=x) must