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)
|
win32console.SetConsoleOutputCP(codepage)
|
||||||
logger.info(
|
logger.info(
|
||||||
"Console output code page: %s" % ctypes.windll.kernel32.GetConsoleOutputCP())
|
"Console output code page: %s" % ctypes.windll.kernel32.GetConsoleOutputCP())
|
||||||
except Exception as e:
|
except Exception as e: # pragma: no cover
|
||||||
logger.info(e)
|
# I hope this code is unreachable...
|
||||||
|
logger.error(e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.create_connection(**kwargs)
|
self.create_connection(**kwargs)
|
||||||
@ -132,8 +133,9 @@ class ConsoleReaderBase:
|
|||||||
|
|
||||||
logger.info(f'Child pid: {self.child_pid} Console pid: {self.console_pid}')
|
logger.info(f'Child pid: {self.child_pid} Console pid: {self.console_pid}')
|
||||||
|
|
||||||
except Exception:
|
except Exception: # pragma: no cover
|
||||||
logger.info(traceback.format_exc())
|
# I hope this code is unreachable...
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
return
|
return
|
||||||
|
|
||||||
if interact:
|
if interact:
|
||||||
@ -141,9 +143,9 @@ class ConsoleReaderBase:
|
|||||||
self.interact()
|
self.interact()
|
||||||
|
|
||||||
self.read_loop()
|
self.read_loop()
|
||||||
except Exception:
|
except Exception: # pragma: no cover
|
||||||
|
# I hope this code is unreachable...
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
time.sleep(.1)
|
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
self.terminate_child()
|
self.terminate_child()
|
||||||
@ -153,9 +155,9 @@ class ConsoleReaderBase:
|
|||||||
time.sleep(.1)
|
time.sleep(.1)
|
||||||
self.close_connection()
|
self.close_connection()
|
||||||
logger.info('Console finished.')
|
logger.info('Console finished.')
|
||||||
except Exception:
|
except Exception: # pragma: no cover
|
||||||
|
# I hope this code is unreachable...
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
time.sleep(.1)
|
|
||||||
|
|
||||||
def read_loop(self):
|
def read_loop(self):
|
||||||
paused = False
|
paused = False
|
||||||
|
Loading…
Reference in New Issue
Block a user