py.builtins._totext -> string literals or six.text_type

This commit is contained in:
Anthony Sottile
2018-08-22 19:21:00 -07:00
parent 17eec5b97e
commit 0fc4a806e5
9 changed files with 23 additions and 29 deletions

View File

@@ -509,12 +509,12 @@ class TestAssert_reprcompare(object):
assert "raised in repr()" not in expl
def test_unicode(self):
left = py.builtin._totext("£€", "utf-8")
right = py.builtin._totext("£", "utf-8")
left = u"£€"
right = u"£"
expl = callequal(left, right)
assert expl[0] == py.builtin._totext("'£€' == '£'", "utf-8")
assert expl[1] == py.builtin._totext("- £€", "utf-8")
assert expl[2] == py.builtin._totext("+ £", "utf-8")
assert expl[0] == u"'£€' == '£'"
assert expl[1] == u"- £€"
assert expl[2] == u"+ £"
def test_nonascii_text(self):
"""
@@ -542,7 +542,7 @@ class TestAssert_reprcompare(object):
expl = callequal(left, right)
for line in expl:
assert isinstance(line, py.builtin.text)
msg = py.builtin._totext("\n").join(expl)
msg = u"\n".join(expl)
assert msg