From 4279f20daf48a29158e5470fcf061eb777ab4667 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 Feb 2022 11:19:49 +0530 Subject: [PATCH] Dont depend on the default bash prompt when testing --- kitty_tests/shell_integration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty_tests/shell_integration.py b/kitty_tests/shell_integration.py index d930fbc41..a56d415cc 100644 --- a/kitty_tests/shell_integration.py +++ b/kitty_tests/shell_integration.py @@ -309,11 +309,12 @@ def setup_env(excluded, argv, home_dir, rc='', shell='bash'): with open(os.path.join(home_dir, x), 'w') as f: print(f'echo {x}', file=f) ans['KITTY_BASH_ETC_LOCATION'] = home_dir + ans['PS1'] = 'PROMPT $ ' return ans def run_test(argv, *expected, excluded=()): with self.subTest(argv=argv), self.run_shell(shell='bash', setup_env=partial(setup_env, set(excluded)), cmd=argv) as pty: - pty.wait_till(lambda: '$' in pty.screen_contents()) + pty.wait_till(lambda: 'PROMPT $' in pty.screen_contents()) q = pty.screen_contents() for x in expected: self.assertIn(x, q)