Test examples in the given object's docstring (`f`), using `globs` as globals. Optional argument `name` is used in failure messages. If the optional argument `verbose` is true, then generate output even if there are no failures. `compileflags` gives the set of flags that shoul
(f, globs, verbose=False, name="NoName",
compileflags=None, optionflags=0)
| 2240 | |
| 2241 | |
| 2242 | def run_docstring_examples(f, globs, verbose=False, name="NoName", |
| 2243 | compileflags=None, optionflags=0): |
| 2244 | """ |
| 2245 | Test examples in the given object's docstring (`f`), using `globs` |
| 2246 | as globals. Optional argument `name` is used in failure messages. |
| 2247 | If the optional argument `verbose` is true, then generate output |
| 2248 | even if there are no failures. |
| 2249 | |
| 2250 | `compileflags` gives the set of flags that should be used by the |
| 2251 | Python compiler when running the examples. If not specified, then |
| 2252 | it will default to the set of future-import flags that apply to |
| 2253 | `globs`. |
| 2254 | |
| 2255 | Optional keyword arg `optionflags` specifies options for the |
| 2256 | testing and output. See the documentation for `testmod` for more |
| 2257 | information. |
| 2258 | """ |
| 2259 | # Find, parse, and run all tests in the given module. |
| 2260 | finder = DocTestFinder(verbose=verbose, recurse=False) |
| 2261 | runner = DocTestRunner(verbose=verbose, optionflags=optionflags) |
| 2262 | for test in finder.find(f, name, globs=globs): |
| 2263 | runner.run(test, compileflags=compileflags) |
| 2264 | |
| 2265 | ###################################################################### |
| 2266 | ## 7. Unittest Support |
nothing calls this directly
no test coverage detected
searching dependent graphs…