| 22 | @skipIfNonUnix |
| 23 | class ProcessTest(unittest.TestCase): |
| 24 | def get_app(self): |
| 25 | class ProcessHandler(RequestHandler): |
| 26 | def get(self): |
| 27 | if self.get_argument("exit", None): |
| 28 | # must use os._exit instead of sys.exit so unittest's |
| 29 | # exception handler doesn't catch it |
| 30 | os._exit(int(self.get_argument("exit"))) |
| 31 | if self.get_argument("signal", None): |
| 32 | os.kill(os.getpid(), int(self.get_argument("signal"))) |
| 33 | self.write(str(os.getpid())) |
| 34 | |
| 35 | return Application([("/", ProcessHandler)]) |
| 36 | |
| 37 | def tearDown(self): |
| 38 | if task_id() is not None: |