def test_kill_process_popen(self): process = subprocess.Popen( ['python', '-c', 'import time; time.sleep(1)']) assert ProcessMonitor.is_process_alive(process) ProcessMonitor.kill_process(process) assert not ProcessMonitor.is_process_alive(process)
def test_kill_process_multiprocessing(self): process = Process(target=sleep_1sec) process.start() assert ProcessMonitor.is_process_alive(process) ProcessMonitor.kill_process(process) assert not ProcessMonitor.is_process_alive(process) process = Process(target=sleep_1sec) ProcessMonitor.kill_process(process)