mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
d1ad4955a8
commit
1a7a561e48
@ -188,6 +188,7 @@ def test_identify(tests): # {{{
|
|||||||
if not possibles:
|
if not possibles:
|
||||||
prints('ERROR: No results that passed all tests were found')
|
prints('ERROR: No results that passed all tests were found')
|
||||||
prints('Log saved to', lf)
|
prints('Log saved to', lf)
|
||||||
|
log.close()
|
||||||
dump_log(lf)
|
dump_log(lf)
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
@ -228,6 +229,9 @@ def test_identify_plugin(name, tests, modify_plugin=lambda plugin:None,
|
|||||||
|
|
||||||
times = []
|
times = []
|
||||||
for kwargs, test_funcs in tests:
|
for kwargs, test_funcs in tests:
|
||||||
|
log('#'*80)
|
||||||
|
log('### Running test with:', kwargs)
|
||||||
|
log('#'*80)
|
||||||
prints('Running test with:', kwargs)
|
prints('Running test with:', kwargs)
|
||||||
rq = Queue()
|
rq = Queue()
|
||||||
args = (log, rq, abort)
|
args = (log, rq, abort)
|
||||||
@ -278,6 +282,7 @@ def test_identify_plugin(name, tests, modify_plugin=lambda plugin:None,
|
|||||||
if not possibles:
|
if not possibles:
|
||||||
prints('ERROR: No results that passed all tests were found')
|
prints('ERROR: No results that passed all tests were found')
|
||||||
prints('Log saved to', lf)
|
prints('Log saved to', lf)
|
||||||
|
log.close()
|
||||||
dump_log(lf)
|
dump_log(lf)
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
@ -174,6 +174,16 @@ class Log(object):
|
|||||||
def __exit__(self, *args):
|
def __exit__(self, *args):
|
||||||
self.filter_level = self.orig_filter_level
|
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):
|
class DevNull(Log):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user