diff options
author | Ahn Ki-Wook <ahnkiwook@gmail.com> | 2016-08-26 01:04:14 +0900 |
---|---|---|
committer | Ahn Ki-Wook <ahnkiwook@gmail.com> | 2016-08-26 09:41:40 +0900 |
commit | 856ad719d3f5343d6bbc8c0d01c52846206d01c7 (patch) | |
tree | 63f1a4138883976e3fc4677097b27ccff598a7ba /_pytest | |
parent | 9c45d6cd83fdc7d336377526bdfb6fc0123d29c0 (diff) | |
download | pytest-856ad719d3f5343d6bbc8c0d01c52846206d01c7.tar.gz |
Fix UnicodeEncodeError when string comparison with unicode has failed.
Diffstat (limited to '_pytest')
-rw-r--r-- | _pytest/_code/code.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/_pytest/_code/code.py b/_pytest/_code/code.py index 040e4fc8d..9a6d32665 100644 --- a/_pytest/_code/code.py +++ b/_pytest/_code/code.py @@ -354,7 +354,7 @@ class ExceptionInfo(object): if exprinfo is None and isinstance(tup[1], AssertionError): exprinfo = getattr(tup[1], 'msg', None) if exprinfo is None: - exprinfo = str(tup[1]) + exprinfo = py._builtin._totext(tup[1]) if exprinfo and exprinfo.startswith('assert '): self._striptext = 'AssertionError: ' self._excinfo = tup |