pytest.fail with non-ascii characters raises an internal pytest error

Fix #1178
This commit is contained in:
Bruno Oliveira
2016-03-05 16:09:01 -03:00
parent 3884398055
commit 24d3e01548
4 changed files with 25 additions and 2 deletions

View File

@@ -740,7 +740,7 @@ class FunctionMixin(PyobjMixin):
def _repr_failure_py(self, excinfo, style="long"):
if excinfo.errisinstance(pytest.fail.Exception):
if not excinfo.value.pytrace:
return str(excinfo.value)
return py._builtin._totext(excinfo.value)
return super(FunctionMixin, self)._repr_failure_py(excinfo,
style=style)