Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (18 sloc) 396 Bytes
---
python_doctest: |-
Python 'doctest' cheatsheet
Example Tests:
def double(arg):
"""
Doubles a number argument.
Example:
>>> double(3)
6
"""
return arg * 2
Example Usage:
import sys
if(__name__ == "__main__"):
if(sys.argv[1] == "test"):
import doctest
doctest.testmod()