mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-42934: use TracebackException(compact=True) in unittest.TestResult (GH-24221)
This commit is contained in:
parent
e56d54e447
commit
ba876c44a8
2 changed files with 5 additions and 1 deletions
|
@ -183,7 +183,8 @@ class TestResult(object):
|
||||||
else:
|
else:
|
||||||
length = None
|
length = None
|
||||||
tb_e = traceback.TracebackException(
|
tb_e = traceback.TracebackException(
|
||||||
exctype, value, tb, limit=length, capture_locals=self.tb_locals)
|
exctype, value, tb,
|
||||||
|
limit=length, capture_locals=self.tb_locals, compact=True)
|
||||||
msgLines = list(tb_e.format())
|
msgLines = list(tb_e.format())
|
||||||
|
|
||||||
if self.buffer:
|
if self.buffer:
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Use :class:`~traceback.TracebackException`'s new ``compact`` param in
|
||||||
|
:class:`~unittest.TestResult` to reduce time and memory consumed by
|
||||||
|
traceback formatting.
|
Loading…
Add table
Add a link
Reference in a new issue