Simplify a FormattedExcinfo test
The previous test was better in that it used fakes to test all of the real code paths. The problem with that is that it makes it impossible to simplify the code with `isinstance` checks. So let's just simulate the issue directly with a monkeypatch.
This commit is contained in:
@@ -283,8 +283,6 @@ class Traceback(list):
|
||||
access to Traceback entries.
|
||||
"""
|
||||
|
||||
Entry = TracebackEntry
|
||||
|
||||
def __init__(self, tb, excinfo=None):
|
||||
""" initialize from given python traceback object and ExceptionInfo """
|
||||
self._excinfo = excinfo
|
||||
@@ -292,7 +290,7 @@ class Traceback(list):
|
||||
|
||||
def f(cur):
|
||||
while cur is not None:
|
||||
yield self.Entry(cur, excinfo=excinfo)
|
||||
yield TracebackEntry(cur, excinfo=excinfo)
|
||||
cur = cur.tb_next
|
||||
|
||||
list.__init__(self, f(tb))
|
||||
|
||||
Reference in New Issue
Block a user