diff options
author | Gregory P. Smith <greg@krypto.org> | 2016-11-21 00:25:14 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2016-11-21 00:25:14 (GMT) |
commit | f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d (patch) | |
tree | 9c95d599820021e3f191b3b93ddd0c951c51f7fb /Lib/test/test_subprocess.py | |
parent | cf014413159c1fa2e8b1c1201c07b648b8b0adf2 (diff) | |
download | cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.zip cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.tar.gz cpython-f0e98c510dd9bbc77b2ae3ebc888e6fba1549c5d.tar.bz2 |
Issue #20572: The subprocess.Popen.wait method's undocumented endtime
parameter now raises a DeprecationWarning. It was deprecated in 3.4.
It was never documented prior to that.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 73da195..89de6d1 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1015,6 +1015,19 @@ class ProcessTestCase(BaseTestCase): # time to start. self.assertEqual(p.wait(timeout=3), 0) + def test_wait_endtime(self): + """Confirm that the deprecated endtime parameter warns.""" + p = subprocess.Popen([sys.executable, "-c", "pass"]) + try: + with self.assertWarns(DeprecationWarning) as warn_cm: + p.wait(endtime=time.time()+0.01) + except subprocess.TimeoutExpired: + pass # We're not testing endtime timeout behavior. + finally: + p.kill() + self.assertIn('test_subprocess.py', warn_cm.filename) + self.assertIn('endtime', str(warn_cm.warning)) + def test_invalid_bufsize(self): # an invalid type of the bufsize argument should raise # TypeError. @@ -2777,19 +2790,5 @@ class ContextManagerTests(BaseTestCase): self.assertTrue(proc.stdin.closed) -def test_main(): - unit_tests = (ProcessTestCase, - POSIXProcessTestCase, - Win32ProcessTestCase, - MiscTests, - ProcessTestCaseNoPoll, - CommandsWithSpaces, - ContextManagerTests, - RunFuncTestCase, - ) - - support.run_unittest(*unit_tests) - support.reap_children() - if __name__ == "__main__": unittest.main() |