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

Method test_contains_unicode

testing/test_doctest.py:677–689  ·  view source on GitHub ↗

Fix internal error with docstrings containing non-ascii characters.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

675 reprec.assertoutcome(failed=1, passed=0)
676
677 def test_contains_unicode(self, pytester: Pytester):
678 """Fix internal error with docstrings containing non-ascii characters."""
679 pytester.makepyfile(
680 '''\
681 def foo():
682 """
683 >>> name = 'с' # not letter 'c' but instead Cyrillic 's'.
684 'anything'
685 """
686 '''
687 )
688 result = pytester.runpytest("--doctest-modules")
689 result.stdout.fnmatch_lines(["Got nothing", "* 1 failed in*"])
690
691 def test_ignore_import_errors_on_doctest(self, pytester: Pytester):
692 p = pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected