Package nltk :: Package test :: Module doctest_driver
[hide private]
[frames] | no frames]

Module doctest_driver

source code

A driver for testing interactive python examples in text files and docstrings. This doctest driver performs three functions:

A number of other flags can be given; call the driver with the `--help` option for a complete list.


Version: 0.1

Classes [hide private]
_OutputRedirectingPdb
_SpoofOut
MyDocTestParser
UpdateRunner
A subclass of `DocTestRunner` that checks the output of each example, and replaces the expected output with the actual output for any examples that fail.
Debugger
MyOutputChecker
MyDocTestRunner
Functions [hide private]
 
_exception_traceback(exc_info) source code
 
_indent(s, indent=4) source code
 
find(name) source code
 
import_from_name(name) source code
 
find_module_from_filename(filename)
Given a filename, return a tuple `(basedir, module)`, where `module` is the module's name, and `basedir` is the directory it should be loaded from (this directory should be added to the path to import it).
source code
 
split_pysrc_into_statements(s) source code
 
run(names, optionflags, verbosity, kbinterrupt_continue) source code
 
debug(names, optionflags, verbosity, pm=True) source code
 
update(names, optionflags, verbosity) source code
 
main() source code
Variables [hide private]
  root_dir = '/Users/sb/Documents/workspace/nltk'
  COMPILER_FLAGS = 8192
  CHECK_OPT = <Option at 0x15657120: --check>
  UPDATE_OPT = <Option at 0x3687418: -u/--update>
  DEBUG_OPT = <Option at 0x3687e68: --debug>
  VERBOSE_OPT = <Option at 0x3687f30: -v/--verbose>
  QUIET_OPT = <Option at 0x3687be8: -q/--quiet>
  UDIFF_OPT = <Option at 0x36874e0: -d/--udiff>
  CDIFF_OPT = <Option at 0x3687738: --cdiff>
  NDIFF_OPT = <Option at 0x36876c0: --ndiff>
  COVERAGE_OPT = <Option at 0x36877d8: --coverage>
  CONTINUE_OPT = <Option at 0x36878c8: --continue>
  ELLIPSIS_OPT = <Option at 0x3687918: --ellipsis>
  NORMWS_OPT = <Option at 0x3687e18: --normalize_whitespace>
Function Details [hide private]

find_module_from_filename(filename)

source code 

Given a filename, return a tuple `(basedir, module)`, where `module` is the module's name, and `basedir` is the directory it should be loaded from (this directory should be added to the path to import it). Packages are handled correctly.