def test_kill(self): sproc = test_func.get_test_subprocess() test_pid = sproc.pid p = psutil.Process(test_pid) kill_child_processes(test_pid) p.wait() self.assertFalse(psutil.pid_exists(test_pid))
# elif args.wlocation: # loactionfinder.finder(args.target) async def main(): print_logo("wplay") create_dirs() parser = get_arg_parser() try: await get_and_match_args(parser) sys.exit(0) except KeyboardInterrupt: __logger.error('User Pressed Ctrl+C') sys.exit(0) try: asyncio.get_event_loop().run_until_complete(main()) except KeyboardInterrupt: __logger.error('User Pressed Ctrl+C') except AssertionError: try: for task in asyncio.all_tasks(): task.cancel() except RuntimeError: exit() exit() finally: kill_child_processes(os.getpid())