MCPcopy Index your code
hub / github.com/ipython/ipython / _get_report_choice

Function _get_report_choice

IPython/testing/plugin/pytest_ipdoctest.py:856–870  ·  view source on GitHub ↗

Return the actual `ipdoctest` module flag value. We want to do it as late as possible to avoid importing `ipdoctest` and all its dependencies when parsing options, as it adds overhead and breaks tests.

(key: str)

Source from the content-addressed store, hash-verified

854
855
856def _get_report_choice(key: str) -> int:
857 """Return the actual `ipdoctest` module flag value.
858
859 We want to do it as late as possible to avoid importing `ipdoctest` and all
860 its dependencies when parsing options, as it adds overhead and breaks tests.
861 """
862 import doctest
863
864 return {
865 DOCTEST_REPORT_CHOICE_UDIFF: doctest.REPORT_UDIFF,
866 DOCTEST_REPORT_CHOICE_CDIFF: doctest.REPORT_CDIFF,
867 DOCTEST_REPORT_CHOICE_NDIFF: doctest.REPORT_NDIFF,
868 DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE: doctest.REPORT_ONLY_FIRST_FAILURE,
869 DOCTEST_REPORT_CHOICE_NONE: 0,
870 }[key]
871
872
873@pytest.fixture(scope="session")

Callers 1

repr_failureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…