Show "short test summary info" after tracebacks and warnings #3255
Currently when using
When you have a large test suite and a lot of tests fail, the short summary test info easily gets lost amidst the huge number of lines printed by all the tracebacks.
I tracked this to a change introduced in #1305 (by yours truly) which was meant to fix the warnings count, but have this unfortunate side effect.
With the change the output now becomes:
In order to avoid breakages and further surprises I thought better to create a new hook because changing the place where
RonnyPfannschmidt left a comment
i am under the impression this needlessly introduces a new hook, when hook ordering and moving the terminal plug-ins own summary into said hook is sufficient
tryfirst/trylast should match it nicely already
Good point, I was also under that impression but thought opening a PR first to invite comments. BUT if we follow this approach I think we will re-introduce #1305 no?
The original problem was that
self.summary_errors() self.summary_failures() self.summary_warnings() # < warning count captured and shown here self.config.hook.pytest_terminal_summary(terminalreporter=self) # <- pytest-benchmark hook called at this point
@RonnyPfannschmidt suggests that
self.config.hook.pytest_terminal_summary(terminalreporter=self) def pytest_terminal_summary(): self.summary_errors() self.summary_failures() self.summary_warnings()
I'm pretty sure this will work and not introduce a regression as