summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_subprocess.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index c441cdcd66..5add023944 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -766,8 +766,24 @@ class ProcessTestCase(unittest.TestCase):
p.terminate()
self.assertNotEqual(p.wait(), 0)
+
+unit_tests = [ProcessTestCase]
+
+if subprocess._has_poll:
+ class ProcessTestCaseNoPoll(ProcessTestCase):
+ def setUp(self):
+ subprocess._has_poll = False
+ ProcessTestCase.setUp(self)
+
+ def tearDown(self):
+ subprocess._has_poll = True
+ ProcessTestCase.tearDown(self)
+
+ unit_tests.append(ProcessTestCaseNoPoll)
+
+
def test_main():
- test_support.run_unittest(ProcessTestCase)
+ test_support.run_unittest(*unit_tests)
if hasattr(test_support, "reap_children"):
test_support.reap_children()