import re


def normalizeTimeDiff(outputStr):
    """
    use regular expression to normalize the time output

    e.g.
    =================== 1059 passed, 8 warnings in 7.99 seconds ===================

    becomes
    =================== 1059 passed, 8 warnings in x.xx seconds ===================
    """

    match = re.search(b"in [0-9]+.[0-9][0-9](s| seconds)", outputStr)
    if match:
        return (
            outputStr[: match.start()] + b"in x.xx seconds" + outputStr[match.end() :]
        )
    return outputStr