merge next chunk from master and fix changelog linting issue
This commit is contained in:
@@ -4,8 +4,11 @@ import operator
|
||||
import _pytest
|
||||
import py
|
||||
import pytest
|
||||
from _pytest._code.code import (FormattedExcinfo, ReprExceptionInfo,
|
||||
ExceptionChainRepr)
|
||||
from _pytest._code.code import (
|
||||
ExceptionInfo,
|
||||
FormattedExcinfo,
|
||||
ReprExceptionInfo,
|
||||
ExceptionChainRepr)
|
||||
|
||||
queue = py.builtin._tryimport('queue', 'Queue')
|
||||
|
||||
@@ -1048,3 +1051,18 @@ raise ValueError()
|
||||
assert tw.lines[40] == "E AttributeError"
|
||||
assert tw.lines[41] == ""
|
||||
assert tw.lines[42].endswith("mod.py:15: AttributeError")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("style", ["short", "long"])
|
||||
@pytest.mark.parametrize("encoding", [None, "utf8", "utf16"])
|
||||
def test_repr_traceback_with_unicode(style, encoding):
|
||||
msg = u'☹'
|
||||
if encoding is not None:
|
||||
msg = msg.encode(encoding)
|
||||
try:
|
||||
raise RuntimeError(msg)
|
||||
except RuntimeError:
|
||||
e_info = ExceptionInfo()
|
||||
formatter = FormattedExcinfo(style=style)
|
||||
repr_traceback = formatter.repr_traceback(e_info)
|
||||
assert repr_traceback is not None
|
||||
|
||||
Reference in New Issue
Block a user