示例#1
0
def test_check_failed1(caplog):
    checkv.check_failed()

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == "Unconditional check failed."
    assert (caplog.text.endswith("Unconditional check failed.\n"))
示例#2
0
def test_check_failed3c(caplog):
    """Appends a dot at the end of the message if necessary."""

    checkv.check_failed("x")

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == "x."
示例#3
0
def test_check_failed5(caplog):
    checkv.check_failed(checker=my_checker)

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == "Unconditional check failed."
示例#4
0
def test_check_failed4(caplog):
    checkv.check_failed(result="for my data.")

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == "Unconditional check failed for my data."
示例#5
0
def test_check_failed3(caplog):
    checkv.check_failed("Checking my data.")

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == "Checking my data."
示例#6
0
def test_check_failed2(caplog):
    checkv.check_failed("")

    for record in caplog.records:
        assert record.levelname == "ERROR"
        assert record.msg == ""