Ejemplo n.º 1
0
def test_fatal_number():
    """
    fatal(non-string) should throw a SystemExit with str(message)
    """
    msg = 32.198
    with pytest.raises(SystemExit) as err:
        tbx.fatal(msg)
    assert str(msg) in str(err)
Ejemplo n.º 2
0
def test_fatal_msg():
    """
    fatal(non-empty message) should throw a SystemExit with the message
    """
    msg = 'This is a fatal error message'
    with pytest.raises(SystemExit) as err:
        tbx.fatal(msg)
    assert msg in str(err)
Ejemplo n.º 3
0
def test_fatal_empty():
    """
    fatal(empty message) should throw a SystemExit with some non-empty message
    """
    exp = 'Fatal error with no reason specified'
    with pytest.raises(SystemExit) as err:
        tbx.fatal()
    assert exp in str(err)
Ejemplo n.º 4
0
def test_fatal_number():
    """
    fatal(non-string) should throw a SystemExit with str(message)
    """
    pytest.dbgfunc()
    msg = 32.198
    with pytest.raises(SystemExit) as err:
        tbx.fatal(msg)
    assert str(msg) in str(err.value)
Ejemplo n.º 5
0
def test_fatal_msg():
    """
    fatal(non-empty message) should throw a SystemExit with the message
    """
    pytest.dbgfunc()
    msg = 'This is a fatal error message'
    with pytest.raises(SystemExit) as err:
        tbx.fatal(msg)
    assert msg in str(err.value)
Ejemplo n.º 6
0
def test_fatal_empty():
    """
    fatal(empty message) should throw a SystemExit with some non-empty message
    """
    pytest.dbgfunc()
    exp = 'Fatal error with no reason specified'
    with pytest.raises(SystemExit) as err:
        tbx.fatal()
    assert exp in str(err.value)