Skip to content

Instantly share code, notes, and snippets.

@chrisglass
Created October 23, 2018 10:19
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/894dd161e4de4204eafcb08297ca9aeb to your computer and use it in GitHub Desktop.
Save chrisglass/894dd161e4de4204eafcb08297ca9aeb to your computer and use it in GitHub Desktop.
import pytest
def test_something():
with pytest.raises(BlahException) as blah:
do_something_that_raises()
with pytest.raises(BlahException) as blah:
do_something_that_raises() # This fails as if it didn't raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment