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

Function test_unicode_in_longrepr

testing/test_runner.py:798–818  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

796
797
798def test_unicode_in_longrepr(pytester: Pytester) -> None:
799 pytester.makeconftest(
800 """\
801 import pytest
802 @pytest.hookimpl(hookwrapper=True)
803 def pytest_runtest_makereport():
804 outcome = yield
805 rep = outcome.get_result()
806 if rep.when == "call":
807 rep.longrepr = 'ä'
808 """
809 )
810 pytester.makepyfile(
811 """
812 def test_out():
813 assert 0
814 """
815 )
816 result = pytester.runpytest()
817 assert result.ret == 1
818 assert "UnicodeEncodeError" not in result.stderr.str()
819
820
821def test_failure_in_setup(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

strMethod · 0.80
makeconftestMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected