Do not describe when there's no summary (#6681)

This commit is contained in:
Carlos Mocholí 2021-03-26 15:58:05 +01:00 committed by GitHub
parent bc613611e2
commit b730a5a281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -148,7 +148,9 @@ class BaseProfiler(AbstractProfiler):
# so to avoid them, we open and close the files within this function # so to avoid them, we open and close the files within this function
# by calling `_prepare_streams` and `teardown` # by calling `_prepare_streams` and `teardown`
self._prepare_streams() self._prepare_streams()
self._write_stream(self.summary()) summary = self.summary()
if summary:
self._write_stream(summary)
if self._output_file is not None: if self._output_file is not None:
self._output_file.flush() self._output_file.flush()
self.teardown(stage=self._stage) self.teardown(stage=self._stage)