Beispiel #1
0
def test_killsubprocess():
    popen = subprocess.Popen([sys.executable, '-c', 'raw_input()'],
                             stdin=subprocess.PIPE)
    time.sleep(0.9)
    assert popen.poll() is None
    assert popen.poll() is None
    killsubprocess(popen)
    waitdead(popen)
Beispiel #2
0
def test_killsubprocess():
    popen = subprocess.Popen([sys.executable, '-c', 'raw_input()'],
                             stdin=subprocess.PIPE)
    time.sleep(0.9)
    assert popen.poll() is None
    assert popen.poll() is None
    killsubprocess(popen)
    waitdead(popen)
Beispiel #3
0
def test_already_dead_and_polled():
    popen = subprocess.Popen([sys.executable, '-c', 'pass'],
                             stdin=subprocess.PIPE)
    waitdead(popen)
    killsubprocess(popen)
    assert popen.poll() is not None
Beispiel #4
0
def test_already_dead_but_no_poll():
    popen = subprocess.Popen([sys.executable, '-c', 'pass'],
                             stdin=subprocess.PIPE)
    time.sleep(3)    # a safe margin to be sure the subprocess is already dead
    killsubprocess(popen)
    assert popen.poll() is not None
Beispiel #5
0
def test_already_dead_and_polled():
    popen = subprocess.Popen([sys.executable, '-c', 'pass'],
                             stdin=subprocess.PIPE)
    waitdead(popen)
    killsubprocess(popen)
    assert popen.poll() is not None
Beispiel #6
0
def test_already_dead_but_no_poll():
    popen = subprocess.Popen([sys.executable, '-c', 'pass'],
                             stdin=subprocess.PIPE)
    time.sleep(3)    # a safe margin to be sure the subprocess is already dead
    killsubprocess(popen)
    assert popen.poll() is not None