Pass exitstatus to pytest_terminal_summary hook

This is useful to know if a testrun has been interrupted
(EXIT_INTERRUPTED).
This commit is contained in:
Daniel Hahler
2016-08-14 15:02:35 +02:00
parent 99a4a1a784
commit 5b95ee3c19
3 changed files with 6 additions and 3 deletions

View File

@@ -361,7 +361,8 @@ class TerminalReporter:
EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, EXIT_USAGEERROR,
EXIT_NOTESTSCOLLECTED)
if exitstatus in summary_exit_codes:
self.config.hook.pytest_terminal_summary(terminalreporter=self)
self.config.hook.pytest_terminal_summary(terminalreporter=self,
exitstatus=exitstatus)
self.summary_errors()
self.summary_failures()
self.summary_warnings()