Fix '--show-capture=no' capture teardown logs

Add a check before printing teardown logs.

'print_teardown_sections' method does not check '--show-capture' option
value, and teardown logs are always printed.

Resolves: #3816
This commit is contained in:
Sankt Petersbug
2018-08-20 14:25:01 -05:00
parent 7d4c4c66d4
commit 223eef6261
3 changed files with 46 additions and 0 deletions

View File

@@ -706,7 +706,12 @@ class TerminalReporter(object):
self._outrep_summary(rep)
def print_teardown_sections(self, rep):
showcapture = self.config.option.showcapture
if showcapture == "no":
return
for secname, content in rep.sections:
if showcapture != "all" and showcapture not in secname:
continue
if "teardown" in secname:
self._tw.sep("-", secname)
if content[-1:] == "\n":