def METHOD_NAME(path: Path) -> Iterator[Path]:
    violations: list[tuple[Path, int]] = []
    violations_msgs: set[str] = set()
    parent_dir_files = _get_files_from_dir(path, violations)
    error_msg = (
        "The following directory contains too many functional tests files:\n"
    )
    for _file_or_dir in parent_dir_files:
        if _file_or_dir.is_dir():
            _files = _get_files_from_dir(_file_or_dir, violations)
            yield _file_or_dir.resolve()
            try:
                yield from METHOD_NAME(_file_or_dir)
            except AssertionError as e:
                violations_msgs.add(str(e).replace(error_msg, ""))
        else:
            yield _file_or_dir.resolve()
    if violations or violations_msgs:
        _msg = error_msg
        for offending_file, number in violations:
            _msg += f"- {offending_file}: {number} when the max is {max_file_per_directory}\n"
        for error_msg in violations_msgs:
            _msg += error_msg
        raise AssertionError(_msg)