MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _run_doctest

Method _run_doctest

test/base/test_tutorials.py:64–88  ·  view source on GitHub ↗
(self, *fnames)

Source from the content-addressed store, hash-verified

62 self._teardown_logger()
63
64 def _run_doctest(self, *fnames):
65 here = os.path.dirname(__file__)
66 sqla_base = os.path.normpath(os.path.join(here, "..", ".."))
67
68 optionflags = (
69 doctest.ELLIPSIS
70 | doctest.NORMALIZE_WHITESPACE
71 | doctest.IGNORE_EXCEPTION_DETAIL
72 )
73 runner = doctest.DocTestRunner(
74 verbose=config.options.verbose >= 2, optionflags=optionflags
75 )
76 parser = doctest.DocTestParser()
77 globs = {"print_function": print}
78
79 try:
80 self._run_doctest_impl(fnames, sqla_base, runner, parser, globs)
81 finally:
82 # Clear all references from doctest execution
83 globs.clear()
84
85 # Delete references to avoid keeping stack frames alive
86 del runner
87 del parser
88 del globs
89
90 def _run_doctest_impl(self, fnames, sqla_base, runner, parser, globs):
91 for fname in fnames:

Callers 9

test_20_styleMethod · 0.95
test_core_operatorsMethod · 0.95
test_orm_quickstartMethod · 0.95
test_asyncioMethod · 0.95

Calls 3

_run_doctest_implMethod · 0.95
joinMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected