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

classobj_type MyDocTestRunner

source code

doctest.DocTestRunner --+
                        |
                       MyDocTestRunner

Instance Methods [hide private]
 
__init__(self, checker=None, verbosity=1, optionflags=0, kbinterrupt_continue=False)
Create a new test runner.
source code
 
report_start(self, out, test, example)
Report that the test runner is about to process the given example.
source code
 
report_failure(self, out, test, example, got)
Report that the given example failed.
source code
 
report_unexpected_exception(self, out, test, example, exc_info)
Report that the given example raised an unexpected exception.
source code
 
_failure_header(self, test, example) source code
 
run(self, test, compileflags=None, out=None, clear_globs=True)
Run the examples in test, and display the results using the writer function out.
source code

Inherited from doctest.DocTestRunner: merge, report_success, summarize

Class Variables [hide private]

Inherited from doctest.DocTestRunner: DIVIDER

Method Details [hide private]

__init__(self, checker=None, verbosity=1, optionflags=0, kbinterrupt_continue=False)
(Constructor)

source code 

Create a new test runner.

Optional keyword arg checker is the OutputChecker that should be used to compare the expected outputs and actual outputs of doctest examples.

Optional keyword arg 'verbose' prints lots of stuff if true, only failures if false; by default, it's true iff '-v' is in sys.argv.

Optional argument optionflags can be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation for testmod for more information.

Overrides: doctest.DocTestRunner.__init__
(inherited documentation)

report_start(self, out, test, example)

source code 
Report that the test runner is about to process the given example. (Only displays a message if verbose=True)
Overrides: doctest.DocTestRunner.report_start
(inherited documentation)

report_failure(self, out, test, example, got)

source code 
Report that the given example failed.
Overrides: doctest.DocTestRunner.report_failure
(inherited documentation)

report_unexpected_exception(self, out, test, example, exc_info)

source code 
Report that the given example raised an unexpected exception.
Overrides: doctest.DocTestRunner.report_unexpected_exception
(inherited documentation)

_failure_header(self, test, example)

source code 
Overrides: doctest.DocTestRunner._failure_header

run(self, test, compileflags=None, out=None, clear_globs=True)

source code 

Run the examples in test, and display the results using the writer function out.

The examples are run in the namespace test.globs. If clear\_globs is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use clear\_globs=False.

compileflags gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to globs.

The output of each example is checked using DocTestRunner.check\_output, and the results are formatted by the DocTestRunner.report\_* methods.

Overrides: doctest.DocTestRunner.run
(inherited documentation)