Skip to content

Index

test_quality

Test-quality rules — analyses for pyramid level, tautologies, mocks, etc.

This subpackage houses rules that operate on the tests/ tree rather than src/. _shared exposes the AST-based primitives reused by every rule in this package.

compute_canonical_name(test_file, project_path)

Public canonical-name helper for one integration/e2e test file.

Returns None when the file is not in an integration/e2e tier, has no tests, or has no first-party symbol coverage. Otherwise returns the canonical test_*.py basename FILE_NAMING would emit.

Source code in packages/axm-audit/src/axm_audit/core/rules/test_quality/file_naming.py
Python
def compute_canonical_name(test_file: Path, project_path: Path) -> str | None:
    """Public canonical-name helper for one integration/e2e test file.

    Returns ``None`` when the file is not in an integration/e2e tier,
    has no tests, or has no first-party symbol coverage. Otherwise
    returns the canonical ``test_*.py`` basename FILE_NAMING would emit.
    """
    verdict = _verdict_for_file(test_file, project_path)
    return verdict.canonical if verdict is not None else None