Skip to content

Instantly share code, notes, and snippets.

@chrisglass
Created October 23, 2018 10:21
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 chrisglass/4f59bc77cdc901258901f3c047637f85 to your computer and use it in GitHub Desktop.
Save chrisglass/4f59bc77cdc901258901f3c047637f85 to your computer and use it in GitHub Desktop.
import pytest
def test_something():
# Notice how the "as blah" is missing
with pytest.raises(BlahException):
do_something_that_raises()
with pytest.raises(BlahException):
do_something_that_raises() # This succeeds as if it raised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment