Improve display of hint about --fulltrace with KeyboardInterrupt

- display the location first
- display hint about --fulltrace in parenthesis
This commit is contained in:
Daniel Hahler 2018-06-07 01:18:51 +02:00
parent 18157659ca
commit c30c137a95
3 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1 @@
Improve display of hint about --fulltrace with KeyboardInterrupt

View File

@ -617,11 +617,11 @@ class TerminalReporter(object):
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):

View File

@ -203,7 +203,7 @@ class TestTerminal(object):
)
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*"])