Add docs and CHANGELOG for ALLOW_UNICODE option

This commit is contained in:
Bruno Oliveira 2015-08-12 22:13:42 -03:00
parent 420823070b
commit 93aee0f814
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,11 @@
with parametrization markers. with parametrization markers.
Thanks to Markus Unterwaditzer for the PR. 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 - parametrize now also generates meaningful test IDs for enum, regex and class
objects (as opposed to class instances). objects (as opposed to class instances).
Thanks to Florian Bruhin for the PR. Thanks to Florian Bruhin for the PR.

View File

@ -72,3 +72,18 @@ ignore lengthy exception stack traces you can just write::
# content of pytest.ini # content of pytest.ini
[pytest] [pytest]
doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL 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'