Respect unicode in AssertionError argument
This is related to issue319
This commit is contained in:
parent
90b6ccd321
commit
a5c075c4e2
|
@ -2,17 +2,17 @@ import sys
|
||||||
import py
|
import py
|
||||||
from _pytest.assertion.util import BuiltinAssertionError
|
from _pytest.assertion.util import BuiltinAssertionError
|
||||||
|
|
||||||
|
|
||||||
class AssertionError(BuiltinAssertionError):
|
class AssertionError(BuiltinAssertionError):
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
BuiltinAssertionError.__init__(self, *args)
|
BuiltinAssertionError.__init__(self, *args)
|
||||||
if args:
|
if args:
|
||||||
try:
|
try:
|
||||||
self.msg = str(args[0])
|
self.msg = py.builtin._totext(args[0])
|
||||||
except py.builtin._sysex:
|
except Exception:
|
||||||
raise
|
self.msg = py.builtin._totext(
|
||||||
except:
|
"<[broken __repr__] %s at %0xd> %s"
|
||||||
self.msg = "<[broken __repr__] %s at %0xd>" %(
|
% (args[0].__class__, id(args[0])))
|
||||||
args[0].__class__, id(args[0]))
|
|
||||||
else:
|
else:
|
||||||
f = py.code.Frame(sys._getframe(1))
|
f = py.code.Frame(sys._getframe(1))
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue