Skip to content

Commit

Permalink
Improve display of hint about --fulltrace with KeyboardInterrupt
Browse files Browse the repository at this point in the history
- display the location first
- display hint about --fulltrace in parenthesis
  • Loading branch information
blueyed committed Jun 7, 2018
1 parent 1815765 commit c30c137
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/3545.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve display of hint about --fulltrace with KeyboardInterrupt
4 changes: 2 additions & 2 deletions src/_pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,11 @@ def _report_keyboardinterrupt(self):
if self.config.option.fulltrace:
excrepr.toterminal(self._tw)
else:
excrepr.reprcrash.toterminal(self._tw)
self._tw.line(
"to show a full traceback on KeyboardInterrupt use --fulltrace",
"(to show a full traceback on KeyboardInterrupt use --fulltrace)",
yellow=True,
)
excrepr.reprcrash.toterminal(self._tw)

def _locationline(self, nodeid, fspath, lineno, domain):

Expand Down
2 changes: 1 addition & 1 deletion testing/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_interrupt_me():
)
else:
result.stdout.fnmatch_lines(
["to show a full traceback on KeyboardInterrupt use --fulltrace"]
["(to show a full traceback on KeyboardInterrupt use --fulltrace)"]
)
result.stdout.fnmatch_lines(["*KeyboardInterrupt*"])

Expand Down

0 comments on commit c30c137

Please sign in to comment.