A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_r
(*paths, **kw)
| 2568 | return DocFileCase(test, **options) |
| 2569 | |
| 2570 | def DocFileSuite(*paths, **kw): |
| 2571 | """A unittest suite for one or more doctest files. |
| 2572 | |
| 2573 | The path to each doctest file is given as a string; the |
| 2574 | interpretation of that string depends on the keyword argument |
| 2575 | "module_relative". |
| 2576 | |
| 2577 | A number of options may be provided as keyword arguments: |
| 2578 | |
| 2579 | module_relative |
| 2580 | If "module_relative" is True, then the given file paths are |
| 2581 | interpreted as os-independent module-relative paths. By |
| 2582 | default, these paths are relative to the calling module's |
| 2583 | directory; but if the "package" argument is specified, then |
| 2584 | they are relative to that package. To ensure os-independence, |
| 2585 | "filename" should use "/" characters to separate path |
| 2586 | segments, and may not be an absolute path (i.e., it may not |
| 2587 | begin with "/"). |
| 2588 | |
| 2589 | If "module_relative" is False, then the given file paths are |
| 2590 | interpreted as os-specific paths. These paths may be absolute |
| 2591 | or relative (to the current working directory). |
| 2592 | |
| 2593 | package |
| 2594 | A Python package or the name of a Python package whose directory |
| 2595 | should be used as the base directory for module relative paths. |
| 2596 | If "package" is not specified, then the calling module's |
| 2597 | directory is used as the base directory for module relative |
| 2598 | filenames. It is an error to specify "package" if |
| 2599 | "module_relative" is False. |
| 2600 | |
| 2601 | setUp |
| 2602 | A set-up function. This is called before running the |
| 2603 | tests in each file. The setUp function will be passed a DocTest |
| 2604 | object. The setUp function can access the test globals as the |
| 2605 | globs attribute of the test passed. |
| 2606 | |
| 2607 | tearDown |
| 2608 | A tear-down function. This is called after running the |
| 2609 | tests in each file. The tearDown function will be passed a DocTest |
| 2610 | object. The tearDown function can access the test globals as the |
| 2611 | globs attribute of the test passed. |
| 2612 | |
| 2613 | globs |
| 2614 | A dictionary containing initial global variables for the tests. |
| 2615 | |
| 2616 | optionflags |
| 2617 | A set of doctest option flags expressed as an integer. |
| 2618 | |
| 2619 | parser |
| 2620 | A DocTestParser (or subclass) that should be used to extract |
| 2621 | tests from the files. |
| 2622 | |
| 2623 | encoding |
| 2624 | An encoding that will be used to convert the files to unicode. |
| 2625 | """ |
| 2626 | suite = _DocTestSuite() |
| 2627 |
no test coverage detected