Add docs and CHANGELOG for ALLOW_UNICODE option
This commit is contained in:
parent
420823070b
commit
93aee0f814
|
@ -7,6 +7,11 @@
|
|||
with parametrization markers.
|
||||
Thanks to Markus Unterwaditzer for the PR.
|
||||
|
||||
- fix issue710: introduce ALLOW_UNICODE doctest option: when enabled, the
|
||||
``u`` prefix is stripped from unicode strings in expected doctest output. This
|
||||
allows doctests which use unicode to run in Python 2 and 3 unchanged.
|
||||
Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR.
|
||||
|
||||
- parametrize now also generates meaningful test IDs for enum, regex and class
|
||||
objects (as opposed to class instances).
|
||||
Thanks to Florian Bruhin for the PR.
|
||||
|
|
|
@ -72,3 +72,18 @@ ignore lengthy exception stack traces you can just write::
|
|||
# content of pytest.ini
|
||||
[pytest]
|
||||
doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
|
||||
|
||||
|
||||
py.test also introduces a new ``ALLOW_UNICODE`` option flag: when enabled, the
|
||||
``u`` prefix is stripped from unicode strings in expected doctest output. This
|
||||
allows doctests which use unicode to run in Python 2 and 3 unchanged.
|
||||
|
||||
As with any other option flag, this flag can be enabled in ``pytest.ini`` using
|
||||
the ``doctest_optionflags`` ini option or by an inline comment in the doc test
|
||||
itself::
|
||||
|
||||
# content of example.rst
|
||||
>>> get_unicode_greeting() # doctest: +ALLOW_UNICODE
|
||||
'Hello'
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue