def test_get_running_kernels(self): import subprocess kernel = subprocess.Popen(["python", "-m", "cwlkernel"]) pids = [] try: pids = CWLLogger.get_running_kernels() except Exception: pass finally: kernel.kill() self.assertIn(kernel.pid, pids)
def test_get_running_kernels(self): import subprocess import sys kernel = subprocess.Popen([f"{sys.executable}", "-m", "cwlkernel"]) pids = [] try: pids = CWLLogger.get_running_kernels() except Exception as e: print(f'ERROR:::: {e}') finally: kernel.kill() self.assertIn(kernel.pid, pids)