Skip to main content

Module colocated_test

Module colocated_test 

Source
Expand description

The unit colocated-test check (Python — issue #15; TypeScript — issue #18; exemptions — issue #32).

Convention (README “Colocated Test”; internals/*/testing.md): a source file is unit-tested by a colocated test named after it — foo.pyfoo_test.py (Python), foo-bar.tsfoo-bar.test.ts (TypeScript). missing_unit_tests walks a tree for a Language and returns every source file with no such sibling — an “orphan”. Test files are what the check looks for, never subjects.

Two things are not orphans even without a colocated test (issue #32): a file that holds no code (empty or comment-only — e.g. a bare __init__.py), which is not a subject at all, and a file listed in the config exempt table, which is a deliberate, reason-required omission. Everything else must be tested — there is no automatic name- or shape-based exemption.

Enums§

Language
A language whose colocated unit-test convention can be checked.

Functions§

missing_unit_tests
Walk root recursively and return every source file (for language) that has no colocated unit test, sorted for deterministic output.