def METHOD_NAME(
    name: str,
    total: int,
    passed: int,
    time: timedelta,
    *,
    justify: bool = True,
) -> str:
    """Generate a test result summary line.
    The output is bright green if all tests passed, otherwise bright red.
    Parameters
    ----------
    name : str
        A name to display in this summary line.
    total : int
        The total number of tests to report.
    passed : int
        The number of passed tests to report.
    time : timedelta
        The time taken to run the tests
    """
    METHOD_NAME = (
        f"{name}: Passed {passed} of {total} tests ({passed/total*100:0.1f}%) "
        f"in {time.total_seconds():0.2f}s"
        if total > 0
        else f"{name}: 0 tests are running, Please check"
    )
    color = green if passed == total and total > 0 else red
    return bright(color(f"{METHOD_NAME: >{UI_WIDTH}}" if justify else METHOD_NAME))