cheat sheets.

$ cheat 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()
Version 1, updated 1048 days ago.
. o 0 ( edit | history )
( add new | see all )