Orchestrata Ultimate › Tests › Reference › scripts › test_test_isolation_audit

Tests reference — tests/scripts/test_test_isolation_audit.py

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

Prose pending.

tests/scripts/test_test_isolation_audit.py

source · 56 tests · 795 lines

Tests for scripts/test_isolation_audit.py — the test-isolation violation auditor.

Kind Name Line Description
function test_extract_string_literals_plain_string 76
function test_extract_string_literals_fstring 84
function test_is_in_docstring_odd_triple_quote_count_is_inside 97
function test_is_in_docstring_even_triple_quote_count_is_outside 103
function test_check_cypher_hardcoded_name_flagged 114
function test_check_cypher_generic_name_not_flagged 123
function test_check_cypher_name_with_test_id_context_not_flagged 131
function test_check_cypher_name_under_interpolated_label_not_flagged 142 The per-test throwaway-label discipline IS isolation.
function test_check_cypher_name_under_literal_label_still_flagged 158 The genuinely unsafe shape must keep failing: a LITERAL label plus a
function test_check_cypher_comment_line_skipped 169
function test_check_cypher_file_hardcoded_path_flagged 178
function test_check_cypher_file_hardcoded_path_with_test_id_token_skipped 189
function test_check_cypher_file_param_path_with_test_id_context_skipped 198
function test_check_cypher_file_no_hardcoded_path_no_test_id_cautious_flag 210
function test_check_fixture_scope_module_flagged 226
function test_check_fixture_scope_class_read_only_neo4j_driver_skipped 235
function test_check_fixture_scope_session_read_only_env_skipped 247
function test_check_fixture_scope_module_with_t4_optin_not_flagged 260 The AGENTS.md T4 opt-in is the project's formal blessing for module
function test_check_fixture_scope_session_with_t4_optin_still_flagged 276 T4 blesses module scope only — the annotation cannot launder session
function test_check_fixture_scope_module_without_optin_still_flagged 291
function test_check_fixture_scope_function_not_flagged 303
function test_check_ast_patterns_no_longer_flags_os_environ_mutation 316 OS_ENVIRON_MUTATION moved to gate_rules.pl:env_mutation on 2026-08-08.
function test_check_ast_patterns_monkeypatch_param_flagged 334
function test_check_ast_patterns_monkeypatch_kwonly_param_flagged 344
function test_check_ast_patterns_hardcoded_port_flagged 354
function test_check_ast_patterns_low_port_not_flagged 367
function test_check_ast_patterns_standard_redis_port_not_flagged 376
function test_check_ast_patterns_standard_neo4j_port_not_flagged 385
function test_check_ast_patterns_config_constructor_not_flagged 394
function test_check_ast_patterns_redis_factory_not_flagged 403
function test_check_ast_patterns_bad_connection_context_not_flagged 412
function test_check_ast_patterns_module_level_dict_assign_no_crash 425
function test_check_ast_patterns_tuple_target_assign_no_crash 437
function test_check_module_level_state_flags_dict_at_module_level 451
function test_check_module_level_state_flags_list_and_set 460
function test_check_module_level_state_inside_function_not_flagged 468
function test_check_module_level_state_after_class_dedent_flagged 476
function test_check_pytest_patterns_mark_skip_flagged 491
function test_check_pytest_patterns_skip_call_flagged 500
function test_check_pytest_patterns_comment_line_not_flagged 508
function test_check_pytest_patterns_docstring_not_flagged 516
function test_check_pytest_patterns_quoted_line_not_flagged 524
function test_scan_file_aggregates_multiple_violation_types 537
function test_scan_file_parse_error 553
function test_main_missing_target 585
function test_main_accepts_individual_files 596 A file path is a valid target, not only a directory.
function test_main_accepts_several_paths 618 Several targets at once, mixing a file and a directory.
function test_main_no_violations 634
function test_main_with_violations_reports_summary 647
function test_main_fix_flag_prints_fix_hints 663
function test_main_skips_pycache_and_generated_dirs 677
function test_main_default_path_argument 705
function test_gate_ok_waives_fixture_scope_directly_above_decorator 718
function test_gate_ok_does_not_waive_monkeypatch 731 MONKEYPATCH is not waivable, and after 2026-08-08 nothing in
function test_file_level_waiver_drops_only_named_category 762
function test_file_level_waiver_requires_reason 784