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)
| 548 | or `None` if the string is unavailable. |
| 549 | """ |
| 550 | def __init__(self, examples, globs, name, filename, lineno, docstring): |
| 551 | """ |
| 552 | Create a new DocTest containing the given examples. The |
| 553 | DocTest's globals are initialized with a copy of `globs`. |
| 554 | """ |
| 555 | assert not isinstance(examples, str), \ |
| 556 | "DocTest no longer accepts str; use DocTestParser instead" |
| 557 | self.examples = examples |
| 558 | self.docstring = docstring |
| 559 | self.globs = globs.copy() |
| 560 | self.name = name |
| 561 | self.filename = filename |
| 562 | self.lineno = lineno |
| 563 | |
| 564 | def __repr__(self): |
| 565 | if len(self.examples) == 0: |