Orchestrata Ultimate › Tests › Reference › scripts › test_ast_orphans

Tests reference — tests/scripts/test_ast_orphans.py

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

Prose pending.

tests/scripts/test_ast_orphans.py

source · 18 tests · 467 lines

Tests for the orphans subcommand of the AST tool

Kind Name Line Description
function test_module_imported_by_script_root_is_reachable 65
function test_script_with_plain_first_party_import_is_reachable 79 A script using plain import app.wired (not from ... import)
function test_script_with_relative_import_does_not_crash 96 A script (not itself a package member) doing from . import x must
function test_transitive_island_both_modules_are_orphans 116 A pair of modules that only import EACH OTHER, with no path from any
function test_main_guard_module_is_root_and_reachable 139
function test_module_with_no_main_guard_is_not_a_root 161
function test_pyproject_scripts_entry_is_reachable 178
function test_pyproject_entry_into_package_init_is_reachable 195 A [project.scripts] target may itself be a PACKAGE whose init.py
function test_pyproject_entry_points_table_is_reachable 220 [project.entry-points."group.name"] targets (plugin-style entry
function test_missing_scripts_dir_yields_no_script_roots 239 A nonexistent scripts/ dir must not crash — it simply seeds no roots.
function test_unparseable_script_is_skipped_not_fatal 253 A script with a syntax error must be skipped, not crash the scan.
function test_orchestrata_ultimate_dunder_main_is_a_root 269 orchestrata_ultimate.__main__ is a hardcoded root (d) — distinct
function test_reaching_submodule_marks_package_ancestors_reachable 290 Reaching app.pkg.sub.mod must mark packages app.pkg and
function test_write_baseline_then_check_is_clean 330
function test_check_new_orphan_fails_with_exit_one 365
function test_check_shrink_is_advisory_exit_zero 398
function test_check_missing_baseline_exits_two 433
function test_human_mode_no_flags_lists_orphans 452