def get_tester_classes(test_file):
    """Get all classes in a model test file whose names ends with `ModelTester`."""
    tester_classes = []
    test_module = get_test_module(test_file)
    for attr in dir(test_module):
        if attr.endswith("ModelTester"):
            tester_classes.append(getattr(test_module, attr))

    # sort with class names
    return sorted(tester_classes, key=lambda x: x.__name__)
Get all classes in a model test file whose names ends with `ModelTester`.
dpkd/transformers/utils/get_test_info.py