MCPcopy
hub / github.com/pytest-dev/pytest / _get_runner

Function _get_runner

src/_pytest/doctest.py:231–248  ·  view source on GitHub ↗
(
    checker: doctest.OutputChecker | None = None,
    verbose: bool | None = None,
    optionflags: int = 0,
    continue_on_failure: bool = True,
)

Source from the content-addressed store, hash-verified

229
230
231def _get_runner(
232 checker: doctest.OutputChecker | None = None,
233 verbose: bool | None = None,
234 optionflags: int = 0,
235 continue_on_failure: bool = True,
236) -> doctest.DocTestRunner:
237 # We need this in order to do a lazy import on doctest
238 global RUNNER_CLASS
239 if RUNNER_CLASS is None:
240 RUNNER_CLASS = _init_runner_class()
241 # Type ignored because the continue_on_failure argument is only defined on
242 # PytestDoctestRunner, which is lazily defined so can't be used as a type.
243 return RUNNER_CLASS( # type: ignore
244 checker=checker,
245 verbose=verbose,
246 optionflags=optionflags,
247 continue_on_failure=continue_on_failure,
248 )
249
250
251class DoctestItem(Item):

Callers 2

collectMethod · 0.85
collectMethod · 0.85

Calls 1

_init_runner_classFunction · 0.85

Tested by

no test coverage detected