Perform a specialized doctest.
(self, decorator, input_lines, found, submitted)
| 886 | return output |
| 887 | |
| 888 | def custom_doctest(self, decorator, input_lines, found, submitted): |
| 889 | """ |
| 890 | Perform a specialized doctest. |
| 891 | |
| 892 | """ |
| 893 | from .custom_doctests import doctests |
| 894 | |
| 895 | args = decorator.split() |
| 896 | doctest_type = args[1] |
| 897 | if doctest_type in doctests: |
| 898 | doctests[doctest_type](self, args, input_lines, found, submitted) |
| 899 | else: |
| 900 | e = "Invalid option to @doctest: {0}".format(doctest_type) |
| 901 | raise Exception(e) |
| 902 | |
| 903 | |
| 904 | class IPythonDirective(Directive): |