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()cheat sheets.
$ cheat python_doctest( add new | see all )
- updated sheets

- mysql_select
- cheat
- cryptsetup
- burm
- perl
- port
- yuilang
- queriac
- mechanize
- sness
- nonsense
- haml
- git
- assert_valid
- marsmission
Advertisement