Tests for the Python scripts in scripts/. Run them from the repository root:
python3 -m pytest -q scripts/tests
conftest.py puts scripts/ on sys.path and provides the load_script helper for scripts with dashes in their names.
test_script_docs.py is the script-docs checker. Every entry point under scripts/ (a *.sh file, a *.py file with a top-level if __name__ == "__main__":, or an extensionless file with a shell or Python shebang) needs a <name>.md next to it with the standard sections (When to use, Usage, Options, What it does, Output and exit codes, Gotchas, See also), and every flag the script declares must appear in the doc's Options section. Exceptions go in scripts/script-docs-exclude.txt, one pattern per line with a mandatory # reason.
test_push.py covers push.py: each precheck, commit_and_push against real temp git repos (nothing staged, staged, unpushed commits, never stages), the plan rows and the dry run.
test_check_fences.py covers check-code-fences.py, check-java-fences.py and code_fences.py. Its Java test needs a JDK (~/jdk/default/bin/java or java on the path) and is skipped without one.
test_check_topic_template.py, test_apply_renames.py and test_renumber_topics.py cover check-topic-template.py, apply-renames.py and renumber-topics.py. They build small docs trees under pytest's tmp_path and pass them with --docs-dir, so they never touch the live pages.
test_check_guide_snippets.py covers check-guide-snippets.py (pointer resolution, region markers, normalization, the guide-page pointer rule).
test_project_index.py covers the projects.ts parser (project_index.py); test_check_project_pages.py covers check-project-pages.py and the old-name patterns (project_old_names.py), building small trees under tmp_path. test_check_doc_inventory.py covers check-doc-inventory.py, which now reads the module list from projects.ts.
test_check_entry_pages.py covers check-entry-pages.py (K0-K5 and the allow-list), building small docs and Juneau trees under tmp_path.
test_verify_docs.py covers verify-docs.py: the sidebars.ts parser (numbered(...) and group(...) read through, other calls rejected, the legacy shape still parsed), the retired check 10, check 16 (the Guides section) and the guide-link cases of check 11.
test_generate_ai_artifacts.py covers generate-ai-artifacts.py: the records, llms.txt (sections taken from Getting Started, Guides and the children of Documentation) and --check.
test_sidebars.py loads the real sidebars.ts with jiti (needs node and npm ci; it fails rather than skips without them) and checks the generated numbers, the groups, Articles, Release Notes, that every page id appears in the sidebar exactly once, and that the Python parser agrees with the resolved tree.