From 55ede897b9949df2175c5d0e5c2a6bbf44b42645 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Feb 2022 10:11:42 +0530 Subject: [PATCH] faster fail --- kitty_tests/ssh.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kitty_tests/ssh.py b/kitty_tests/ssh.py index 39469f140..51ce1d73b 100644 --- a/kitty_tests/ssh.py +++ b/kitty_tests/ssh.py @@ -78,7 +78,13 @@ print(' '.join(map(str, buf)))'''), lines=13, cols=77) self.assertFalse(os.path.exists(os.path.join(home_dir, '.terminfo/kitty.terminfo'))) pty = self.create_pty(f'{sh} -c {shlex.quote(script)}', cwd=home_dir, env=env) del script - pty.wait_till(lambda: 'UNTAR_DONE' in pty.screen_contents()) + + def check_untar_or_fail(): + q = pty.screen_contents() + if 'bzip2' in q: + raise ValueError('Untarring failed with screen contents:\n' + q) + return 'UNTAR_DONE' in q + pty.wait_till(check_untar_or_fail) self.assertTrue(os.path.exists(os.path.join(home_dir, '.terminfo/kitty.terminfo'))) if SHELL_INTEGRATION_VALUE != 'enabled': pty.wait_till(lambda: len(pty.screen_contents().splitlines()) > 1)