Skip to content

Commit 5221a14

Browse files
committed
Failing test case for #3583
1 parent 4d0297b commit 5221a14

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

testing/test_doctest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,22 @@ def fix_bad_unicode(text):
655655
result = testdir.runpytest(p, "--doctest-modules")
656656
result.stdout.fnmatch_lines(["* 1 passed *"])
657657

658+
def test_print_unicode_value(self, testdir):
659+
"""
660+
Test case for issue 3583: Printing Unicode in doctest under Python 2.7
661+
doesn't work
662+
"""
663+
p = testdir.maketxtfile(
664+
test_print_unicode_value=r"""
665+
Here is a doctest::
666+
667+
>>> print(u'\xE5\xE9\xEE\xF8\xFC')
668+
åéîøü
669+
"""
670+
)
671+
result = testdir.runpytest(p)
672+
result.stdout.fnmatch_lines(["* 1 passed *"])
673+
658674
def test_reportinfo(self, testdir):
659675
"""
660676
Test case to make sure that DoctestItem.reportinfo() returns lineno.

0 commit comments

Comments
 (0)