Skip to content

Instantly share code, notes, and snippets.

@AndyLPK247
Created March 14, 2017 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyLPK247/5b9057d6f668e020d0dce3e2571066a0 to your computer and use it in GitHub Desktop.
Save AndyLPK247/5b9057d6f668e020d0dce3e2571066a0 to your computer and use it in GitHub Desktop.
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