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

Function _run_object_doctest

Lib/test/test_zipimport_support.py:40–56  ·  view source on GitHub ↗
(obj, module)

Source from the content-addressed store, hash-verified

38
39
40def _run_object_doctest(obj, module):
41 finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
42 runner = doctest.DocTestRunner(verbose=verbose)
43 # Use the object's fully qualified name if it has one
44 # Otherwise, use the module's name
45 try:
46 name = "%s.%s" % (obj.__module__, obj.__qualname__)
47 except AttributeError:
48 name = module.__name__
49 for example in finder.find(obj, name, module):
50 runner.run(example)
51 f, t = runner.failures, runner.tries
52 if f:
53 raise test.support.TestFailed("%d of %d doctests failed" % (f, t))
54 if verbose:
55 print ('doctest (%s) ... %d tests with zero failures' % (module.__name__, t))
56 return f, t
57
58
59

Callers 1

Calls 2

findMethod · 0.95
runMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…