fix tests trying to raise exc_info=True

This commit is contained in:
lilydjwg 2022-06-12 14:22:14 +08:00
parent 8b32c26d1e
commit 914c6414e8

View File

@ -82,7 +82,11 @@ def raise_on_logger_msg():
def proc(logger, method_name, event_dict):
if method_name in ('warning', 'error'):
if 'exc_info' in event_dict:
raise event_dict['exc_info']
exc = event_dict['exc_info']
if isinstance(exc, Exception):
raise exc
else: # exc_info=True
raise
if not event_dict['event'].startswith(('rate limited', 'no-result')):
raise RuntimeError(event_dict['event'])
return event_dict['event']