ID EN
Unittest

discover

Python 3.11

Find all the test modules by recursing into subdirectories from the specified start directory, and return a TestSuite object containing them. Only test files that match pattern will be loaded. (Using shell style pattern matching.) Only module names that are importable (i.e. are valid Python identifiers) will be loaded.

Syntax

PYTHON
discover(start_dir, pattern='test*.py', top_level_dir=None)

See Also

SkipTest SkipTest namespace packages namespace packages