adds a bit of doctest hint on why the key and value getters are separate functions.

This commit is contained in:
Romain Dorgueil 2016-07-23 15:19:18 +02:00
parent 1a33025a76
commit ec7695e15d
1 changed files with 11 additions and 3 deletions

View File

@ -295,7 +295,18 @@ def _get_allow_bytes_flag():
return doctest.register_optionflag('ALLOW_BYTES')
def _get_report_choices_keys():
"""
Returns the report choices keys. Separate function (see just below) because this is used to declare options and
we can't import the doctest module at that time.
"""
return ('udiff', 'cdiff', 'ndiff', 'only_first_failure', 'none', )
def _get_report_choices():
"""
See `_get_report_choices_keys` to understand why this strange implementation. Be careful with order, the values
order should be the same as the returned keys above.
"""
import doctest
return dict(
zip(
@ -304,9 +315,6 @@ def _get_report_choices():
)
)
def _get_report_choices_keys():
return ('udiff', 'cdiff', 'ndiff', 'only_first_failure', 'none', )
@pytest.fixture(scope='session')
def doctest_namespace():
"""