py.builtins._totext -> string literals or six.text_type
This commit is contained in:
@@ -3,7 +3,6 @@ from __future__ import absolute_import, division, print_function
|
||||
import sys
|
||||
|
||||
import _pytest._code
|
||||
import py
|
||||
import pytest
|
||||
from test_excinfo import TWMock
|
||||
from six import text_type
|
||||
@@ -83,7 +82,7 @@ def test_code_from_func():
|
||||
|
||||
|
||||
def test_unicode_handling():
|
||||
value = py.builtin._totext("\xc4\x85\xc4\x87\n", "utf-8").encode("utf8")
|
||||
value = u"ąć".encode("UTF-8")
|
||||
|
||||
def f():
|
||||
raise Exception(value)
|
||||
@@ -96,7 +95,7 @@ def test_unicode_handling():
|
||||
|
||||
@pytest.mark.skipif(sys.version_info[0] >= 3, reason="python 2 only issue")
|
||||
def test_unicode_handling_syntax_error():
|
||||
value = py.builtin._totext("\xc4\x85\xc4\x87\n", "utf-8").encode("utf8")
|
||||
value = u"ąć".encode("UTF-8")
|
||||
|
||||
def f():
|
||||
raise SyntaxError("invalid syntax", (None, 1, 3, value))
|
||||
|
||||
Reference in New Issue
Block a user