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

Function _get_checker

src/_pytest/doctest.py:672–689  ·  view source on GitHub ↗

Return a doctest.OutputChecker subclass that supports some additional options: * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b'' prefixes (respectively) in string literals. Useful when the same doctest should run in Python 2 and Python 3. * NUMBER to ignore floa

()

Source from the content-addressed store, hash-verified

670
671
672def _get_checker() -> "doctest.OutputChecker":
673 """Return a doctest.OutputChecker subclass that supports some
674 additional options:
675
676 * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b''
677 prefixes (respectively) in string literals. Useful when the same
678 doctest should run in Python 2 and Python 3.
679
680 * NUMBER to ignore floating-point differences smaller than the
681 precision of the literal number in the doctest.
682
683 An inner class is used to avoid importing "doctest" at the module
684 level.
685 """
686 global CHECKER_CLASS
687 if CHECKER_CLASS is None:
688 CHECKER_CLASS = _init_checker_class()
689 return CHECKER_CLASS()
690
691
692def _get_allow_unicode_flag() -> int:

Callers 4

test_number_reMethod · 0.90
repr_failureMethod · 0.85
collectMethod · 0.85
collectMethod · 0.85

Calls 1

_init_checker_classFunction · 0.85

Tested by

no test coverage detected