'Test wait() behavior when waitpid returns WIFSTOPPED; issue29335.'

@unittest.skipUnless(((_testcapi is not None) and hasattr(_testcapi, 'W_STOPCODE')), 'need    _testcapi.W_STOPCODE')
def test_stopped(self):

    args = [sys.executable, '-c', 'pass']
    proc = subprocess.Popen(args)
    pid = proc.pid
    (pid, status) = os.waitpid(pid, 0)
    self.assertEqual(status, 0)
    status = _testcapi.W_STOPCODE(3)
    with mock.patch('subprocess.os.waitpid', return_value=(pid, status)):
        returncode = proc.wait()
    self.assertEqual(returncode, (-3))
