fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmDisable some more tests under CI2508cc9de

master
955 B42 linesraw
1#!/usr/bin/env python3
2import os
3from pexpect_helper import SpawnedProc
4import signal
5
6sp = SpawnedProc()
7send, sendline, sleep, expect_str, expect_prompt = (
8    sp.send,
9    sp.sendline,
10    sp.sleep,
11    sp.expect_str,
12    sp.expect_prompt,
13)
14expect_prompt()
15
16timeout = 0.15
17
18if "CI" in os.environ:
19    # This doesn't work under TSan, because TSan prevents select() being
20    # interrupted by a signal.
21    import sys
22
23    print("SKIPPING cancel_event.py")
24    sys.exit(127)
25
26# Verify that cancel-commandline does what we expect - see #7384.
27send("not executed")
28sleep(timeout)
29os.kill(sp.spawn.pid, signal.SIGINT)
30sendline("echo marker")
31sp.expect_str("marker")
32expect_prompt()
33
34sendline("function cancelhandler --on-event fish_cancel ; echo yay cancelled ; end")
35expect_prompt()
36send("still not executed")
37sleep(timeout)
38os.kill(sp.spawn.pid, signal.SIGINT)
39expect_str("yay cancelled")
40sendline("echo marker")
41sp.expect_str("marker")
42expect_prompt()