summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2011-03-16 20:57:54 (GMT)
committerReid Kleckner <reid@kleckner.net>2011-03-16 20:57:54 (GMT)
commit2b228f0d9b3bc5ed99162b052c5eae515f55f3b8 (patch)
tree68808b19c1385635c3af66162ca4376cffdcccf7 /Lib/test/test_subprocess.py
parent252183e4b6ebddb15a3f82e33a58b90809a46b9d (diff)
downloadcpython-2b228f0d9b3bc5ed99162b052c5eae515f55f3b8.zip
cpython-2b228f0d9b3bc5ed99162b052c5eae515f55f3b8.tar.gz
cpython-2b228f0d9b3bc5ed99162b052c5eae515f55f3b8.tar.bz2
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__.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 3156543..00cf0d5 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -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)