scipy_doctest.impl.DTRunner¶
- class scipy_doctest.impl.DTRunner(checker=None, verbose=None, optionflags=None, config=None)¶
A drop-in replacement for
doctest.DocTestRunner.Improves how test names are reported and allows better control over exception handling. It integrates with
DTConfigto apply customized settings for doctest execution.Parameters:¶
- checkerdoctest.OutputChecker, optional
A custom output checker, defaults to
DTConfig.CheckerKlass(config).- verbosebool, optional
If
True, enables verbose output.- optionflagsint, optional
Bitwise OR of
doctestoption flags; defaults toDTConfig.optionflags.- configDTConfig, optional
A configuration object controlling doctest behavior; a default instance is used if not provided.
- __init__(checker=None, verbose=None, optionflags=None, config=None)¶
Create a new test runner.
Optional keyword arg
checkeris theOutputCheckerthat 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
optionflagscan be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation fortestmodfor more information.
Methods
__init__([checker, verbose, optionflags, config])Create a new test runner.
get_history()Return a dict with names of items which were run.
merge(other)report_failure(out, test, example, got)Report that the given example failed.
report_start(out, test, example)Report that the test runner is about to process the given example.
report_success(out, test, example, got)Report that the given example ran successfully.
report_unexpected_exception(out, test, ...)Report that the given example raised an unexpected exception.
run(test[, compileflags, out, clear_globs])Run the examples in
test, and display the results using the writer functionout.summarize([verbose])Print a summary of all the test cases that have been run by this DocTestRunner, and return a tuple
(f, t), wherefis the total number of failed examples, andtis the total number of tried examples.Attributes
DIVIDER