diff options
author | Barry Warsaw <barry@python.org> | 2002-04-15 22:14:06 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2002-04-15 22:14:06 (GMT) |
commit | c9ad32c5d14f0ebd635e61b33b6d7d5a12440c1e (patch) | |
tree | a27b610ec09cb1fb2377d606e545f1682a4a7603 /Lib/test/test_email.py | |
parent | 24fd0252c474bb1e4189dd6b92e572343f27f0f9 (diff) | |
download | cpython-c9ad32c5d14f0ebd635e61b33b6d7d5a12440c1e.zip cpython-c9ad32c5d14f0ebd635e61b33b6d7d5a12440c1e.tar.gz cpython-c9ad32c5d14f0ebd635e61b33b6d7d5a12440c1e.tar.bz2 |
test_main(): Added this so the test can actually get run under the
regrtest framework. Keep the original standalone-unittest
scaffolding (i.e. suite() and __main__).
Diffstat (limited to 'Lib/test/test_email.py')
-rw-r--r-- | Lib/test/test_email.py | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Lib/test/test_email.py b/Lib/test/test_email.py index 1322246..efbe271 100644 --- a/Lib/test/test_email.py +++ b/Lib/test/test_email.py @@ -29,8 +29,10 @@ from email import Iterators from email import base64MIME from email import quopriMIME +import test_support from test_support import findfile, __file__ as test_support_file + NL = '\n' EMPTYSTRING = '' SPACE = ' ' @@ -1573,30 +1575,23 @@ class TestHeader(unittest.TestCase): +def _testclasses(): + mod = sys.modules[__name__] + return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] + + def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TestMessageAPI)) - suite.addTest(unittest.makeSuite(TestEncoders)) - suite.addTest(unittest.makeSuite(TestLongHeaders)) - suite.addTest(unittest.makeSuite(TestFromMangling)) - suite.addTest(unittest.makeSuite(TestMIMEAudio)) - suite.addTest(unittest.makeSuite(TestMIMEImage)) - suite.addTest(unittest.makeSuite(TestMIMEText)) - suite.addTest(unittest.makeSuite(TestMultipartMixed)) - suite.addTest(unittest.makeSuite(TestNonConformant)) - suite.addTest(unittest.makeSuite(TestRFC2047)) - suite.addTest(unittest.makeSuite(TestMIMEMessage)) - suite.addTest(unittest.makeSuite(TestIdempotent)) - suite.addTest(unittest.makeSuite(TestMiscellaneous)) - suite.addTest(unittest.makeSuite(TestIterators)) - suite.addTest(unittest.makeSuite(TestParsers)) - suite.addTest(unittest.makeSuite(TestBase64)) - suite.addTest(unittest.makeSuite(TestQuopri)) - suite.addTest(unittest.makeSuite(TestHeader)) - suite.addTest(unittest.makeSuite(TestCharset)) + for testclass in _testclasses(): + suite.addTest(unittest.makeSuite(testclass)) return suite +def test_main(): + for testclass in _testclasses(): + test_support.run_unittest(testclass) + + if __name__ == '__main__': unittest.main(defaultTest='suite') |