MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_doctest

Method get_doctest

Lib/doctest.py:696–706  ·  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

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

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