ALL-TEST0003 · test_module_member_count
Measure top-level test helpers, classes, and tests as one suite navigation width.
This is a deterministic rule for all languages. Read its implementation.
Definition
Section titled “Definition”Count classes and functions declared directly in a test module. This separates production module focus from suite navigation while keeping a strict ceiling on scenario sprawl. The default allows twenty members, compared with twelve for production modules.
Evidence
Section titled “Evidence”Each finding names the test module and its exact top-level member count. The value sums its classes, helpers, and tests rather than the number of parametrized items Pytest collects.
Exceptions
Section titled “Exceptions”Nested declarations and imported helpers do not count. Parametrized cases remain one member and are governed by the dedicated testing rules. A cohesive suite above the ceiling should first remove duplicate intent, aggregate repository-wide invariants, or split by production behavior.
Examples
Section titled “Examples”A file with eighteen tests and two helpers returns 20. A file with twenty-one distinct tests
returns 21 even if every test is short.
References
Section titled “References”- Cites “xUnit Test Patterns”, organizing test code
- Cites “Growing Object-Oriented Software, Guided by Tests”, expressive test suites