def test_divide_when_other_number_is_zero_raises_an_exception():
    with pytest.raises(ZeroDivisionError, match="division by zero"):
        divide(2, 0)
Example #2
0
def test_divide_throws_exception_when_dividing_by_zero():
    assert divide(2, 0)
Example #3
0
def test_divide_throws_exception_when_dividing_by_zero():
    with pytest.raises(ZeroDivisionError, match='division by zero'):
        divide(2, 0)
def test_when_other_number_is_zero_raises_an_exception():
    "Erro ao dividir um nĂºmero por 0"
    with pytest.raises(ZeroDivisionError, match="division by zero"):
        divide(2, 0)