MCPcopy Index your code
hub / github.com/python/cpython / test_wait_negative_timeout

Method test_wait_negative_timeout

Lib/test/test_subprocess.py:1745–1757  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1743 @unittest.skipUnless(hasattr(subprocess, '_winapi'),
1744 'need subprocess._winapi')
1745 def test_wait_negative_timeout(self):
1746 proc = subprocess.Popen(ZERO_RETURN_CMD)
1747 with proc:
1748 patch = mock.patch.object(
1749 subprocess._winapi,
1750 'WaitForSingleObject',
1751 return_value=subprocess._winapi.WAIT_OBJECT_0)
1752 with patch as mock_wait:
1753 proc.wait(-1) # negative timeout
1754 mock_wait.assert_called_once_with(proc._handle, 0)
1755 proc.returncode = None
1756
1757 self.assertEqual(proc.wait(), 0)
1758
1759 def test_post_timeout_communicate_sends_input(self):
1760 """GH-141473 regression test; the stdin pipe must close"""

Callers

nothing calls this directly

Calls 3

waitMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected