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)
| 2644 | return DocFileCase(test, **options) |
| 2645 | |
| 2646 | def DocFileSuite(*paths, **kw): |
| 2647 | """A unittest suite for one or more doctest files. |
| 2648 | |
| 2649 | The path to each doctest file is given as a string; the |
| 2650 | interpretation of that string depends on the keyword argument |
| 2651 | "module_relative". |
| 2652 | |
| 2653 | A number of options may be provided as keyword arguments: |
| 2654 | |
| 2655 | module_relative |
| 2656 | If "module_relative" is True, then the given file paths are |
| 2657 | interpreted as os-independent module-relative paths. By |
| 2658 | default, these paths are relative to the calling module's |
| 2659 | directory; but if the "package" argument is specified, then |
| 2660 | they are relative to that package. To ensure os-independence, |
| 2661 | "filename" should use "/" characters to separate path |
| 2662 | segments, and may not be an absolute path (i.e., it may not |
| 2663 | begin with "/"). |
| 2664 | |
| 2665 | If "module_relative" is False, then the given file paths are |
| 2666 | interpreted as os-specific paths. These paths may be absolute |
| 2667 | or relative (to the current working directory). |
| 2668 | |
| 2669 | package |
| 2670 | A Python package or the name of a Python package whose directory |
| 2671 | should be used as the base directory for module relative paths. |
| 2672 | If "package" is not specified, then the calling module's |
| 2673 | directory is used as the base directory for module relative |
| 2674 | filenames. It is an error to specify "package" if |
| 2675 | "module_relative" is False. |
| 2676 | |
| 2677 | setUp |
| 2678 | A set-up function. This is called before running the |
| 2679 | tests in each file. The setUp function will be passed a DocTest |
| 2680 | object. The setUp function can access the test globals as the |
| 2681 | globs attribute of the test passed. |
| 2682 | |
| 2683 | tearDown |
| 2684 | A tear-down function. This is called after running the |
| 2685 | tests in each file. The tearDown function will be passed a DocTest |
| 2686 | object. The tearDown function can access the test globals as the |
| 2687 | globs attribute of the test passed. |
| 2688 | |
| 2689 | globs |
| 2690 | A dictionary containing initial global variables for the tests. |
| 2691 | |
| 2692 | optionflags |
| 2693 | A set of doctest option flags expressed as an integer. |
| 2694 | |
| 2695 | parser |
| 2696 | A DocTestParser (or subclass) that should be used to extract |
| 2697 | tests from the files. |
| 2698 | |
| 2699 | encoding |
| 2700 | An encoding that will be used to convert the files to unicode. |
| 2701 | """ |
| 2702 | suite = _DocTestSuite() |
| 2703 |
no test coverage detected
searching dependent graphs…