def discover_tests(startdir):
    # Avoid importing unittest
    loader = unittest.TestLoader()
    suite = loader.discover(startdir)
    return suite
Discover test under a directory
dataset/ETHPy150Open numba/llvmlite/llvmlite/tests/__init__.py/discover_tests