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

Class UpdateRunner

source code

doctest.DocTestRunner --+
                        |
                       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.

`UpdateRunner` can be used:

However, care must be taken not to update an example's expected output with an incorrect value.

Instance Methods [hide private]
 
__init__(self, verbose=False, mark_updates=False)
Construct a new update runner
source code
 
run(self, test, compileflags=None, out=None, clear_globs=True)
Run the update runner
source code
 
report_start(self, out, test, example)
Report that the test runner is about to process the given example.
source code
 
report_success(self, out, test, example, got)
Report that the given example ran successfully.
source code
 
report_unexpected_exception(self, out, test, example, exc_info)
Report that the given example raised an unexpected exception.
source code
 
report_failure(self, out, test, example, got)
Report that the given example failed.
source code
 
_report_replacement(self, out, test, example, replacement) source code
 
_header(self, test, example) source code

Inherited from doctest.DocTestRunner: merge, summarize

Inherited from doctest.DocTestRunner (private): _failure_header

Class Variables [hide private]
  DIVIDER = '---------------------------------------------------...
Method Details [hide private]

__init__(self, verbose=False, mark_updates=False)
(Constructor)

source code 

Construct a new update runner

Overrides: doctest.DocTestRunner.__init__

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

source code 

Run the update runner

Overrides: doctest.DocTestRunner.run

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_success(self, out, test, example, got)

source code 
Report that the given example ran successfully. (Only displays a message if verbose=True)
Overrides: doctest.DocTestRunner.report_success
(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)

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

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

Class Variable Details [hide private]

DIVIDER

Value:
'---------------------------------------------------------------------\
-'