diff options
author | Gregory P. Smith <greg@krypto.org> | 2015-04-07 22:57:54 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2015-04-07 22:57:54 (GMT) |
commit | ace55865c5a528d4d2711c468c5da649fa20c4b1 (patch) | |
tree | ea7c26c8da7ca150d9ccc2a1e0625b03b8988bf2 /Lib/test/test_subprocess.py | |
parent | 3c28878e401400c6a51edd84d6d550c42e9441b6 (diff) | |
download | cpython-ace55865c5a528d4d2711c468c5da649fa20c4b1.zip cpython-ace55865c5a528d4d2711c468c5da649fa20c4b1.tar.gz cpython-ace55865c5a528d4d2711c468c5da649fa20c4b1.tar.bz2 |
Addresses Issue #10838: The subprocess now module includes
SubprocessError and TimeoutError in its list of exported names for the
users wild enough to use "from subprocess import *".
MAXFD, mswindows and list2cmdline should be dealt with (renamed or
moved) in separate commits.
Committed at 35,000ft. Thanks chromebook free gogo wifi passes!
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e25cccd..71481bc 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2420,6 +2420,21 @@ class ProcessTestCaseNoPoll(ProcessTestCase): subprocess._PopenSelector = self.orig_selector ProcessTestCase.tearDown(self) + def test__all__(self): + """Ensure that __all__ is populated properly.""" + intentionally_excluded = set(("list2cmdline", "mswindows", "MAXFD")) + exported = set(subprocess.__all__) + possible_exports = set() + import types + for name, value in subprocess.__dict__.items(): + if name.startswith('_'): + continue + if isinstance(value, (types.ModuleType,)): + continue + possible_exports.add(name) + self.assertEqual(exported, possible_exports - intentionally_excluded) + + @unittest.skipUnless(mswindows, "Windows-specific tests") class CommandsWithSpaces (BaseTestCase): |