-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: doctestsrelated to the doctests builtin pluginrelated to the doctests builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
As of pytest 3.6.1, doctests that print
s Unicode output (not just evaluating to Unicode; they have to call print
) are failing with a UnicodeEncodeError
under Python 2.7 but succeeding under Python 3.3+, regardless of locale or whether doctest_encoding = utf-8
is set in pytest.ini
. This has been observed on both Mac OS X and Ubuntu Trusty & Xenial.
This bug was first noticed in https://stackoverflow.com/q/50860112/744178; see there for slightly more information. Issue #2728 may also be related.
Minimal example:
pytest-bug.rst
:
Here is a failing example::
>>> print(u'\xE5\xE9\xEE\xF8\xFC')
åéîøü
Running pytest pyttest-bug.rst
fails under Python 2.7.10 and succeeds under Python 3.6.5.
Metadata
Metadata
Assignees
Labels
plugin: doctestsrelated to the doctests builtin pluginrelated to the doctests builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed