MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_unicode_doctest_module

Method test_unicode_doctest_module

testing/test_doctest.py:747–763  ·  view source on GitHub ↗

Test case for issue 2434: DecodeError on Python 2 when doctest docstring contains non-ascii characters.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected