Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`.
(self, examples, globs, name, filename, lineno, docstring)
| 527 | or `None` if the string is unavailable. |
| 528 | """ |
| 529 | def __init__(self, examples, globs, name, filename, lineno, docstring): |
| 530 | """ |
| 531 | Create a new DocTest containing the given examples. The |
| 532 | DocTest's globals are initialized with a copy of `globs`. |
| 533 | """ |
| 534 | assert not isinstance(examples, str), \ |
| 535 | "DocTest no longer accepts str; use DocTestParser instead" |
| 536 | self.examples = examples |
| 537 | self.docstring = docstring |
| 538 | self.globs = globs.copy() |
| 539 | self.name = name |
| 540 | self.filename = filename |
| 541 | self.lineno = lineno |
| 542 | |
| 543 | def __repr__(self): |
| 544 | if len(self.examples) == 0: |