MCPcopy Create free account
hub / github.com/pytest-dev/pytest / _get_runner

Function _get_runner

src/_pytest/doctest.py:229–246  ·  view source on GitHub ↗
(
    checker: Optional["doctest.OutputChecker"] = None,
    verbose: Optional[bool] = None,
    optionflags: int = 0,
    continue_on_failure: bool = True,
)

Source from the content-addressed store, hash-verified

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

Callers 2

collectMethod · 0.85
collectMethod · 0.85

Calls 1

_init_runner_classFunction · 0.85

Tested by

no test coverage detected