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

Function _get_checker

src/_pytest/doctest.py:662–679  ·  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

660
661
662def _get_checker() -> doctest.OutputChecker:
663 """Return a doctest.OutputChecker subclass that supports some
664 additional options:
665
666 * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b''
667 prefixes (respectively) in string literals. Useful when the same
668 doctest should run in Python 2 and Python 3.
669
670 * NUMBER to ignore floating-point differences smaller than the
671 precision of the literal number in the doctest.
672
673 An inner class is used to avoid importing "doctest" at the module
674 level.
675 """
676 global CHECKER_CLASS
677 if CHECKER_CLASS is None:
678 CHECKER_CLASS = _init_checker_class()
679 return CHECKER_CLASS()
680
681
682def _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