Separate test for SIGWINCH handling

This commit is contained in:
Kovid Goyal 2022-07-13 14:20:39 +05:30
parent df8800b7ff
commit 78542ede14
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -92,12 +92,18 @@ def wait_for_death(exit_code, timeout=5):
# pty = self.create_pty( # pty = self.create_pty(
# argv=[kitty_exe(), '+runpy', src + 'socket_child_main(initial_print="child ready:")'], cols=cols, env=env, cwd=cwd) # argv=[kitty_exe(), '+runpy', src + 'socket_child_main(initial_print="child ready:")'], cols=cols, env=env, cwd=cwd)
# pty.wait_till(lambda: 'child ready:' in pty.screen_contents()) # pty.wait_till(lambda: 'child ready:' in pty.screen_contents())
# pty.set_window_size(columns=cols + 3)
# pty.wait_till(lambda: f'Screen size changed: {cols + 3}' in pty.screen_contents())
# pty.write_to_child('\x03', flush=True) # pty.write_to_child('\x03', flush=True)
# wait_for_death(signal.SIGINT, timeout=30) # wait_for_death(signal.SIGINT, timeout=30)
# pty.wait_till(lambda: 'KeyboardInterrupt' in pty.screen_contents()) # pty.wait_till(lambda: 'KeyboardInterrupt' in pty.screen_contents())
# test SIGWINCH handling
pty = self.create_pty(
argv=[kitty_exe(), '+runpy', src + 'socket_child_main(initial_print="child ready:")'], cols=cols, env=env, cwd=cwd)
pty.wait_till(lambda: 'child ready:' in pty.screen_contents())
pty.set_window_size(columns=cols + 3)
pty.wait_till(lambda: f'Screen size changed: {cols + 3}' in pty.screen_contents())
os.close(pty.master_fd)
# test passing of data via cwd, env vars and stdin/stdout redirection # test passing of data via cwd, env vars and stdin/stdout redirection
stdin_r, stdin_w = os.pipe() stdin_r, stdin_w = os.pipe()
os.set_inheritable(stdin_w, False) os.set_inheritable(stdin_w, False)