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__).
This commit is contained in:
Barry Warsaw 2002-04-15 22:14:06 +00:00
parent 24fd0252c4
commit c9ad32c5d1
2 changed files with 20 additions and 21 deletions

View file

@ -2,7 +2,7 @@
# email package unit tests for (optional) Asian codecs
import unittest
from test_support import TestSkipped
import test_support
from email.Charset import Charset
from email.Header import Header, decode_header
@ -12,7 +12,7 @@ from email.Header import Header, decode_header
try:
unicode('foo', 'japanese.iso-2022-jp')
except LookupError:
raise TestSkipped, 'Optional Japanese codecs not installed'
raise test_support.TestSkipped, 'Optional Japanese codecs not installed'
@ -46,6 +46,10 @@ def suite():
return suite
def test_main():
test_support.run_unittest(TestEmailAsianCodecs)
if __name__ == '__main__':
unittest.main(defaultTest='suite')