@unittest.skipUnless(hasattr(os, 'fork'), 'need os.fork()')
def test_fork(self):
    pid = os.fork()
    if (not pid):
        exitcode = 1
        try:
            exitcode = self.fork_child()
        finally:
            os._exit(exitcode)
    else:
        (pid2, status) = os.waitpid(pid, 0)
        self.assertTrue(os.WIFEXITED(status))
        exitcode = os.WEXITSTATUS(status)
        self.assertEqual(exitcode, 0)
@unittest.skipUnless(hasattr(os, 'fork'), 'need os.fork()')
def test_fork(self):
    pid = os.fork()
    if (not pid):
        exitcode = 1
        try:
            exitcode = self.fork_child()
        finally:
            os._exit(exitcode)
    else:
        (pid2, status) = os.waitpid(pid, 0)
        self.assertTrue(os.WIFEXITED(status))
        exitcode = os.WEXITSTATUS(status)
        self.assertEqual(exitcode, 0)