summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-04-16 11:51:31 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-04-16 11:51:31 (GMT)
commit5cad060e0df84c935d32250f797cb9005de261cd (patch)
treed14c1a9c1e6721349a6a58b5f4f86f7f2f9c82e5 /Lib/test
parent8b04a945eff25ee66746d717b060c1b7844808c9 (diff)
parent23172bd47b46b44d785dd00c6b8b2c9ea759219f (diff)
downloadcpython-5cad060e0df84c935d32250f797cb9005de261cd.zip
cpython-5cad060e0df84c935d32250f797cb9005de261cd.tar.gz
cpython-5cad060e0df84c935d32250f797cb9005de261cd.tar.bz2
Merge subprocess test from 3.5
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_subprocess.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 6628512..c443523 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2518,7 +2518,7 @@ class Win32ProcessTestCase(BaseTestCase):
def test_terminate_dead(self):
self._kill_dead_process('terminate')
-class CommandTests(unittest.TestCase):
+class MiscTests(unittest.TestCase):
def test_getoutput(self):
self.assertEqual(subprocess.getoutput('echo xyzzy'), 'xyzzy')
self.assertEqual(subprocess.getstatusoutput('echo xyzzy'),
@@ -2538,19 +2538,6 @@ class CommandTests(unittest.TestCase):
if dir is not None:
os.rmdir(dir)
-
-@unittest.skipUnless(hasattr(selectors, 'PollSelector'),
- "Test needs selectors.PollSelector")
-class ProcessTestCaseNoPoll(ProcessTestCase):
- def setUp(self):
- self.orig_selector = subprocess._PopenSelector
- subprocess._PopenSelector = selectors.SelectSelector
- ProcessTestCase.setUp(self)
-
- def tearDown(self):
- subprocess._PopenSelector = self.orig_selector
- ProcessTestCase.tearDown(self)
-
def test__all__(self):
"""Ensure that __all__ is populated properly."""
intentionally_excluded = set(("list2cmdline",))
@@ -2566,6 +2553,18 @@ class ProcessTestCaseNoPoll(ProcessTestCase):
self.assertEqual(exported, possible_exports - intentionally_excluded)
+@unittest.skipUnless(hasattr(selectors, 'PollSelector'),
+ "Test needs selectors.PollSelector")
+class ProcessTestCaseNoPoll(ProcessTestCase):
+ def setUp(self):
+ self.orig_selector = subprocess._PopenSelector
+ subprocess._PopenSelector = selectors.SelectSelector
+ ProcessTestCase.setUp(self)
+
+ def tearDown(self):
+ subprocess._PopenSelector = self.orig_selector
+ ProcessTestCase.tearDown(self)
+
@unittest.skipUnless(mswindows, "Windows-specific tests")
class CommandsWithSpaces (BaseTestCase):
@@ -2669,7 +2668,7 @@ def test_main():
unit_tests = (ProcessTestCase,
POSIXProcessTestCase,
Win32ProcessTestCase,
- CommandTests,
+ MiscTests,
ProcessTestCaseNoPoll,
CommandsWithSpaces,
ContextManagerTests,