Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python Testing 101 pytest Example: Math Function Tests (2)
def test_divide_by_zero():
with pytest.raises(ZeroDivisionError) as e:
divide(NUMBER_1, 0)
assert "division by zero" in str(e.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.