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)
| 854 | |
| 855 | |
| 856 | def _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") |
no outgoing calls
no test coverage detected
searching dependent graphs…