def test_divide_when_other_number_is_zero_raises_an_exception():
    with pytest.raises(ZeroDivisionError, match="division by zero"):
        divide(2, 0)
Exemplo n.º 2
0
def test_divide_throws_exception_when_dividing_by_zero():
    assert divide(2, 0)
Exemplo n.º 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)