__all__ = [
'ArgumentParser',
'ArgumentError',
- 'Namespace',
- 'Action',
+ 'ArgumentTypeError',
'FileType',
'HelpFormatter',
+ 'ArgumentDefaultsHelpFormatter',
'RawDescriptionHelpFormatter',
'RawTextHelpFormatter',
- 'ArgumentDefaultsHelpFormatter',
+ 'Namespace',
+ 'Action',
+ 'ONE_OR_MORE',
+ 'OPTIONAL',
+ 'PARSER',
+ 'REMAINDER',
+ 'SUPPRESS',
+ 'ZERO_OR_MORE',
]
# Author: Steven J. Bethard <steven.bethard@gmail.com>.
import codecs
+import inspect
import os
import shutil
import sys
for name in argparse.__all__:
self.assertTrue(hasattr(argparse, name))
+ def test_all_exports_everything_but_modules(self):
+ items = [
+ name
+ for name, value in vars(argparse).items()
+ if not name.startswith("_")
+ if not inspect.ismodule(value)
+ ]
+ self.assertEqual(sorted(items), sorted(argparse.__all__))
+
def test_main():
# silence warnings about version argument - these are expected
with support.check_warnings(