Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42934: use TracebackException's new compact param in unittest.Tes… #24221

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-42934: use TracebackException's new compact param in unittest.Tes…
…tResult
  • Loading branch information
iritkatriel committed Jan 15, 2021
commit 0efd2733935e1d14a56e2a9606c426c96cc4ef4d
3 changes: 2 additions & 1 deletion Lib/unittest/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ def _exc_info_to_string(self, err, test):
else:
length = None
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())

if self.buffer:
Expand Down
Original file line number Diff line number Diff line change
@@ -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.