Skip to content

Instantly share code, notes, and snippets.

@klette
Created April 13, 2010 09:30
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 klette/364458 to your computer and use it in GitHub Desktop.
Save klette/364458 to your computer and use it in GitHub Desktop.
def foo(val):
"""
>>> foo(0)
2
>>> foo(1)
Traceback (most recent call last):
...
ValueError: 1
"""
if val == 1:
raise ValueError(val)
return 2
import doctest
doctest.testmod()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment