scipy_doctest.impl.DTParser¶
- class scipy_doctest.impl.DTParser(config=None)¶
A drop-in replacement for
doctest.DocTestParser
with a stopword list.It filters out stopwords, pseudocode, and random markers from doctests.
Parameters:¶
- configDTConfig, optional
A configuration object containing: -
stopwords
: A list of words that signal a doctest should be ignored. -pseudocode
: A list of markers indicating non-executable code. -rndm_markers
: A list of markers indicating results may vary.
- __init__(config=None)¶
Methods
__init__
([config])get_doctest
(string, globs, name, filename, ...)Extract all doctest examples from the given string, and collect them into a
DocTest
object.get_examples
(string[, name])Get examples from intervening strings and examples.
parse
(string[, name])Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings.