diff options
author | Collin Winter <collinw@gmail.com> | 2007-04-25 17:29:52 +0000 |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-04-25 17:29:52 +0000 |
commit | c2898c5a678e6dd00c3e0b18a214fcd7a3533800 (patch) | |
tree | dfaedbddee7b0ef79a19527788b8a720658e79bb /Lib/test/test_optparse.py | |
parent | 0d4c06e06e5ee1f3bb1fa8068114bd700d74864a (diff) | |
download | cpython-git-c2898c5a678e6dd00c3e0b18a214fcd7a3533800.tar.gz |
Standardize on test.test_support.run_unittest() (as opposed to a mix of run_unittest() and run_suite()). Also, add functionality to run_unittest() that admits usage of unittest.TestLoader.loadTestsFromModule().
Diffstat (limited to 'Lib/test/test_optparse.py')
-rw-r--r-- | Lib/test/test_optparse.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index 9b52659b1f..38d5207b0c 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -1631,18 +1631,8 @@ class TestParseNumber(BaseTest): "option -l: invalid long integer value: '0x12x'") -def _testclasses(): - mod = sys.modules[__name__] - return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] - -def suite(): - suite = unittest.TestSuite() - for testclass in _testclasses(): - suite.addTest(unittest.makeSuite(testclass)) - return suite - def test_main(): - test_support.run_suite(suite()) + test_support.run_unittest(__name__) if __name__ == '__main__': - unittest.main() + test_main() |