Created
March 14, 2017 03:08
-
-
Save AndyLPK247/5b9057d6f668e020d0dce3e2571066a0 to your computer and use it in GitHub Desktop.
Python Testing 101 pytest Example: Math Function Tests (2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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