5.3.1.22.10.3. cli.pre_commit_scripts.check_test_files.PythonTestFiles

class cli.pre_commit_scripts.check_test_files.PythonTestFiles(files: set[Path])

Bases: TestFiles

Handler for Python source and test files.

check_for_missing_test_files(verbose: int = 0) → int

Check for missing test files for each Python source.

Parameters:

verbose – Verbosity level.

Returns:

The number of missing test files.

check_style(verbose: int = 0) → int

Check Python test files for docstring and main/unittest style.

Parameters:

verbose – Verbosity level.

Returns:

The number of style errors found.

check_test_files(verbose: int = 0) → int

Run all checks for Python test files.

Parameters:

verbose – Verbosity level.

Returns:

The total number of errors found.

property test_type: Literal['Python']

Type of test files handled.

Returns:

The string ‘Python’.