MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/doctest.py:550–562  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected