diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-25 23:32:30 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-25 23:32:30 -0400 |
| commit | 9eb7ab1eb24cd54259f6cefbba07383cfb91f4e2 (patch) | |
| tree | fe4e881c92951e71fa354e482fb1892c1e38c05e | |
| parent | 2caa254bac711bb174384d6892e4961c86de1ae8 (diff) | |
| download | cmd2-git-9eb7ab1eb24cd54259f6cefbba07383cfb91f4e2.tar.gz | |
Attempt at fixing unit test failure on Windows
| -rw-r--r-- | tests/test_cmd2.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 2c3a6253..dece1ab4 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1114,8 +1114,13 @@ def test_ansi_prompt_escaped(): readline_safe_prompt = rl_make_safe_prompt(color_prompt) assert prompt != color_prompt - assert readline_safe_prompt.startswith(readline_hack_start + color + readline_hack_end) - assert readline_safe_prompt.endswith(readline_hack_start + Fore.RESET + readline_hack_end) + if sys.platform.startswith('win'): + # PyReadline on Windows doesn't suffer from the GNU readline bug which requires the hack + assert readline_safe_prompt.startswith(color) + assert readline_safe_prompt.endswith(Fore.RESET) + else: + assert readline_safe_prompt.startswith(readline_hack_start + color + readline_hack_end) + assert readline_safe_prompt.endswith(readline_hack_start + Fore.RESET + readline_hack_end) class HelpApp(cmd2.Cmd): |
