This commit is contained in:
Kovid Goyal 2017-03-02 09:37:37 +05:30
parent d1ad4955a8
commit 1a7a561e48
2 changed files with 15 additions and 0 deletions

View File

@ -188,6 +188,7 @@ def test_identify(tests): # {{{
if not possibles:
prints('ERROR: No results that passed all tests were found')
prints('Log saved to', lf)
log.close()
dump_log(lf)
raise SystemExit(1)
@ -228,6 +229,9 @@ def test_identify_plugin(name, tests, modify_plugin=lambda plugin:None,
times = []
for kwargs, test_funcs in tests:
log('#'*80)
log('### Running test with:', kwargs)
log('#'*80)
prints('Running test with:', kwargs)
rq = Queue()
args = (log, rq, abort)
@ -278,6 +282,7 @@ def test_identify_plugin(name, tests, modify_plugin=lambda plugin:None,
if not possibles:
prints('ERROR: No results that passed all tests were found')
prints('Log saved to', lf)
log.close()
dump_log(lf)
raise SystemExit(1)

View File

@ -174,6 +174,16 @@ class Log(object):
def __exit__(self, *args):
self.filter_level = self.orig_filter_level
def flush(self):
for o in self.outputs:
if hasattr(o, 'flush'):
o.flush()
def close(self):
for o in self.outputs:
if hasattr(o, 'close'):
o.close()
class DevNull(Log):