Skip to content

Instantly share code, notes, and snippets.

@RonnyPfannschmidt
Created November 10, 2016 12:35
Show Gist options
  • Save RonnyPfannschmidt/3913fe506bd0bdc3a85dea083db06694 to your computer and use it in GitHub Desktop.
Save RonnyPfannschmidt/3913fe506bd0bdc3a85dea083db06694 to your computer and use it in GitHub Desktop.
import contextlib
@contextlib.contextmanager
def raises_kind(exc_type, kind):
with pytest.raises(exc_type) as e:
yield
assert e.value.kind == kind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment