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

Method get_doctest

Lib/doctest.py:690–700  ·  view source on GitHub ↗

Extract all doctest examples from the given string, and collect them into a `DocTest` object. `globs`, `name`, `filename`, and `lineno` are attributes for the new `DocTest` object. See the documentation for `DocTest` for more information.

(self, string, globs, name, filename, lineno)

Source from the content-addressed store, hash-verified

688 return output
689
690 def get_doctest(self, string, globs, name, filename, lineno):
691 """
692 Extract all doctest examples from the given string, and
693 collect them into a `DocTest` object.
694
695 `globs`, `name`, `filename`, and `lineno` are attributes for
696 the new `DocTest` object. See the documentation for `DocTest`
697 for more information.
698 """
699 return DocTest(self.get_examples(string, name), globs,
700 name, filename, lineno, string)
701
702 def get_examples(self, string, name='<string>'):
703 """

Callers 3

_get_testMethod · 0.80
testfileFunction · 0.80
DocFileTestFunction · 0.80

Calls 2

get_examplesMethod · 0.95
DocTestClass · 0.85

Tested by

no test coverage detected