Add test for unicode assertion descriptions

Also clean up a few debugging leftovers.
This commit is contained in:
Floris Bruynooghe
2013-11-29 00:29:14 +00:00
parent a5c075c4e2
commit e3a945a0b5
3 changed files with 12 additions and 2 deletions
+10
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys
import py, pytest
@@ -176,6 +177,15 @@ class TestAssert_reprcompare:
expl = ' '.join(callequal('foo', 'bar'))
assert 'raised in repr()' not in expl
def test_unicode(self):
left = py.builtin._totext('£€', 'utf-8')
right = py.builtin._totext('£', 'utf-8')
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')
def test_python25_compile_issue257(testdir):
testdir.makepyfile("""
def test_rewritten():