mirror of
https://github.com/clearml/wexpect-venv
synced 2025-01-31 02:46:59 +00:00
[CLN] coverage-report: add no cover for unreachable code
This commit is contained in:
parent
c5ded637ce
commit
0473d4b3e9
@ -117,8 +117,9 @@ class ConsoleReaderBase:
|
||||
win32console.SetConsoleOutputCP(codepage)
|
||||
logger.info(
|
||||
"Console output code page: %s" % ctypes.windll.kernel32.GetConsoleOutputCP())
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
except Exception as e: # pragma: no cover
|
||||
# I hope this code is unreachable...
|
||||
logger.error(e)
|
||||
|
||||
try:
|
||||
self.create_connection(**kwargs)
|
||||
@ -132,8 +133,9 @@ class ConsoleReaderBase:
|
||||
|
||||
logger.info(f'Child pid: {self.child_pid} Console pid: {self.console_pid}')
|
||||
|
||||
except Exception:
|
||||
logger.info(traceback.format_exc())
|
||||
except Exception: # pragma: no cover
|
||||
# I hope this code is unreachable...
|
||||
logger.error(traceback.format_exc())
|
||||
return
|
||||
|
||||
if interact:
|
||||
@ -141,9 +143,9 @@ class ConsoleReaderBase:
|
||||
self.interact()
|
||||
|
||||
self.read_loop()
|
||||
except Exception:
|
||||
except Exception: # pragma: no cover
|
||||
# I hope this code is unreachable...
|
||||
logger.error(traceback.format_exc())
|
||||
time.sleep(.1)
|
||||
finally:
|
||||
try:
|
||||
self.terminate_child()
|
||||
@ -153,9 +155,9 @@ class ConsoleReaderBase:
|
||||
time.sleep(.1)
|
||||
self.close_connection()
|
||||
logger.info('Console finished.')
|
||||
except Exception:
|
||||
except Exception: # pragma: no cover
|
||||
# I hope this code is unreachable...
|
||||
logger.error(traceback.format_exc())
|
||||
time.sleep(.1)
|
||||
|
||||
def read_loop(self):
|
||||
paused = False
|
||||
|
Loading…
Reference in New Issue
Block a user