From df09c85e8db95622820712f29228dac2dc049935 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Thu, 19 Apr 2018 12:49:24 -0400 Subject: Identified and marked a few blocks of code that can't be reached during unit tests due to the lack of a real terminal. Some more comments. --- cmd2/rl_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd2/rl_utils.py') diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py index c00a5784..d5bef1ff 100644 --- a/cmd2/rl_utils.py +++ b/cmd2/rl_utils.py @@ -18,7 +18,7 @@ except ImportError: try: # noinspection PyUnresolvedReferences import readline - except ImportError: + except ImportError: # pragma: no cover pass @@ -51,7 +51,8 @@ def rl_force_redisplay() -> None: """ if not sys.stdout.isatty(): return - if rl_type == RlType.GNU: + + if rl_type == RlType.GNU: # pragma: no cover # rl_forced_update_display() is the proper way to redraw the prompt and line, but we # have to use ctypes to do it since Python's readline API does not wrap the function readline_lib.rl_forced_update_display() @@ -60,6 +61,6 @@ def rl_force_redisplay() -> None: display_fixed = ctypes.c_int.in_dll(readline_lib, "rl_display_fixed") display_fixed.value = 1 - elif rl_type == RlType.PYREADLINE: + elif rl_type == RlType.PYREADLINE: # pragma: no cover # noinspection PyProtectedMember readline.rl.mode._print_prompt() -- cgit v1.2.1