Beispiel #1
0
def test_dangeorus():
    """See if we can cover the missing statements.
    """
    try:
        wordcount_lib.daaaangerous()
        assert False
    except ZeroDivisionError as e:
        assert True, "Throw divide by zero error"
def test_daaaangerous():
    try:
        wordcount_lib.daaaangerous()
        assert False
    except ZeroDivisionError as e:
        assert True, 'Should throw dividebyzero'
def test_daaaangerous():
    try:
        wordcount_lib.daaaangerous()
        assert False
    except ZeroDivisionError as e:
        assert True, 'Should throw dividebyzero'
def test_daaaangerous():
    try:
        wordcount_lib.daaaangerous()
        assert False # we know the function should always fail
    except ZeroDivisionError as e:
        assert True
def test_dividedbyzero():
    try:
        wordcount_lib.daaaangerous()
    except ZeroDivisionError as e:
        assert True, 'Should throw ZeroDivisionError'
Beispiel #6
0
def test_dangerous():
    try:
      wordcount_lib.daaaangerous()
      assert False
    except ZeroDivisionError as e:
      assert True, "Should throw an error"
def test_daaaangerous():
    with pytest.raises(Exception) as e_info:
        wordcount_lib.daaaangerous()
def test_daaaangerous():
    try:
        wordcount_lib.daaaangerous()
        assert False  # we know the function should always fail
    except ZeroDivisionError as e:
        assert True
def test_daaaangerous():
    try:
        wordcount_lib.daaaangerous()
        assert False
    except ZeroDivisionError as e:
        assert True, "Error message ????"