mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Include the timeout value in TimeoutExpired.
This was the original intention, but it wasn't threaded all the way through due to 'endtime'. Also added a trivial assertion to get coverage of __str__.
This commit is contained in:
parent
252183e4b6
commit
2b228f0d9b
2 changed files with 35 additions and 23 deletions
|
@ -651,7 +651,9 @@ class ProcessTestCase(BaseTestCase):
|
|||
def test_wait_timeout(self):
|
||||
p = subprocess.Popen([sys.executable,
|
||||
"-c", "import time; time.sleep(0.1)"])
|
||||
self.assertRaises(subprocess.TimeoutExpired, p.wait, timeout=0.01)
|
||||
with self.assertRaises(subprocess.TimeoutExpired) as c:
|
||||
p.wait(timeout=0.01)
|
||||
self.assertIn("0.01", str(c.exception)) # For coverage of __str__.
|
||||
self.assertEqual(p.wait(timeout=2), 0)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue