Test case for issue 2434: DecodeError on Python 2 when doctest docstring contains non-ascii characters.
(self, pytester: Pytester)
| 745 | ) |
| 746 | |
| 747 | def test_unicode_doctest_module(self, pytester: Pytester): |
| 748 | """ |
| 749 | Test case for issue 2434: DecodeError on Python 2 when doctest docstring |
| 750 | contains non-ascii characters. |
| 751 | """ |
| 752 | p = pytester.makepyfile( |
| 753 | test_unicode_doctest_module=""" |
| 754 | def fix_bad_unicode(text): |
| 755 | ''' |
| 756 | >>> print(fix_bad_unicode('único')) |
| 757 | único |
| 758 | ''' |
| 759 | return "único" |
| 760 | """ |
| 761 | ) |
| 762 | result = pytester.runpytest(p, "--doctest-modules") |
| 763 | result.stdout.fnmatch_lines(["* 1 passed *"]) |
| 764 | |
| 765 | def test_print_unicode_value(self, pytester: Pytester): |
| 766 | """ |
nothing calls this directly
no test coverage detected