def METHOD_NAME(self, logger):
    timer = Timer(logger)
    with timer():
        time.sleep(0.01)
    assert re.match(
        r"elapsed time: [0-9]\.[0-9]{3}s", logger.handlers[0].stream.getvalue()
    )
    # do it again but with custom level
    with timer("redo it", level=logging.WARNING):
        time.sleep(0.02)
    assert re.search(
        r"WARNING: Took [0-9]\.[0-9]{3}s to redo it",
        logger.handlers[0].stream.getvalue(),
    )