From c30c137a9568571ac89f2c99658174f44eb19220 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 7 Jun 2018 01:18:51 +0200 Subject: [PATCH 1/2] Improve display of hint about --fulltrace with KeyboardInterrupt - display the location first - display hint about --fulltrace in parenthesis --- changelog/3545.trivial.rst | 1 + src/_pytest/terminal.py | 4 ++-- testing/test_terminal.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/3545.trivial.rst diff --git a/changelog/3545.trivial.rst b/changelog/3545.trivial.rst new file mode 100644 index 000000000..48f334eac --- /dev/null +++ b/changelog/3545.trivial.rst @@ -0,0 +1 @@ +Improve display of hint about --fulltrace with KeyboardInterrupt diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 94b416556..a985ab221 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -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): diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 7c9d8ccf7..68ce51d43 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -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*"]) From 942d363c03e028a9e625f52cf9658f03839bafc2 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 7 Jun 2018 18:55:50 -0300 Subject: [PATCH 2/2] Improve changelog formatting --- changelog/3545.trivial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/3545.trivial.rst b/changelog/3545.trivial.rst index 48f334eac..0b98f78b1 100644 --- a/changelog/3545.trivial.rst +++ b/changelog/3545.trivial.rst @@ -1 +1 @@ -Improve display of hint about --fulltrace with KeyboardInterrupt +Improve display of hint about ``--fulltrace`` with ``KeyboardInterrupt``.