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
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) source code
 
debug(names, optionflags, verbosity, pm=True) source code
 
update(names, optionflags, verbosity) source code
 
main() source code
Variables [hide private]
  root_dir = u'/Volumes/Data/nltk'
  CHECK_OPT = <Option at 0x7639f30: --check>
  UPDATE_OPT = <Option at 0x7640058: -u/--update>
  DEBUG_OPT = <Option at 0x7640288: --debug>
  VERBOSE_OPT = <Option at 0x76405d0: -v/--verbose>
  QUIET_OPT = <Option at 0x7640508: -q/--quiet>
  UDIFF_OPT = <Option at 0x7640580: -d/--udiff>
  CDIFF_OPT = <Option at 0x7640800: --cdiff>
  NDIFF_OPT = <Option at 0x7640648: --ndiff>
  COVERAGE_OPT = <Option at 0x7640670: --coverage>
  ELLIPSIS_OPT = <Option at 0x7640698: --ellipsis>
  NORMWS_OPT = <Option at 0x76406e8: --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.