def test_base(self): cmd = "%s -c 'import time; time.sleep(2)'" process = Process('test', cmd % sys.executable, shell=True) try: info = process.info() self.assertEqual(process.pid, info['pid']) age = process.age() self.assertTrue(age > 0.) self.assertFalse(process.is_child(0)) finally: process.stop()
def test_base(self): cmd = sys.executable args = "-c 'import time; time.sleep(2)'" process = Process('test', cmd, args=args, shell=False) try: info = process.info() self.assertEqual(process.pid, info['pid']) age = process.age() self.assertTrue(age > 0.) self.assertFalse(process.is_child(0)) finally: process.stop()
def test_base(self): cmd = sys.executable args = "-c 'import time; time.sleep(2)'" process = Process("test", cmd, args=args, shell=False) try: info = process.info() self.assertEqual(process.pid, info["pid"]) age = process.age() self.assertTrue(age > 0.0) self.assertFalse(process.is_child(0)) finally: process.stop()
def test_base(self): cmd = PYTHON args = "-c 'import time; time.sleep(10)'" process = Process('test', cmd, args=args, shell=False, use_fds=USE_FDS) try: info = process.info() self.assertEqual(process.pid, info['pid']) # Make sure the process lived a measurable amount of time # (precision error on Windows) time.sleep(0.01) age = process.age() self.assertTrue(age > 0.) self.assertFalse(process.is_child(0)) finally: process.stop()
def test_base(self): cmd = PYTHON args = "-c 'import time; time.sleep(10)'" process = Process('test', 1, cmd, args=args, shell=False, use_fds=USE_FDS) try: info = process.info() self.assertEqual(process.pid, info['pid']) # Make sure the process lived a measurable amount of time # (precision error on Windows) time.sleep(0.01) age = process.age() self.assertTrue(age > 0.) self.assertFalse(process.is_child(0)) finally: process.stop()