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

Method test_unicode_string

testing/test_doctest.py:914–926  ·  view source on GitHub ↗

Test that doctests which output unicode fail in Python 2 when the ALLOW_UNICODE option is not used. The same test should pass in Python 3.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

912 reprec.assertoutcome(passed=2)
913
914 def test_unicode_string(self, pytester: Pytester):
915 """Test that doctests which output unicode fail in Python 2 when
916 the ALLOW_UNICODE option is not used. The same test should pass
917 in Python 3.
918 """
919 pytester.maketxtfile(
920 test_doc="""
921 >>> b'12'.decode('ascii')
922 '12'
923 """
924 )
925 reprec = pytester.inline_run()
926 reprec.assertoutcome(passed=1)
927
928 def test_bytes_literal(self, pytester: Pytester):
929 """Test that doctests which output bytes fail in Python 3 when

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
maketxtfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected