diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-05-06 21:35:05 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-05-06 21:35:05 (GMT) |
commit | f73a48cbb21605bded9e78df1c74d8af108290a1 (patch) | |
tree | 0664b5bccec2448b28a220bd1d9ef17594fd43c9 /Lib | |
parent | 823c626b43ab00f349b88897f265695e76fdfd13 (diff) | |
download | cpython-f73a48cbb21605bded9e78df1c74d8af108290a1.zip cpython-f73a48cbb21605bded9e78df1c74d8af108290a1.tar.gz cpython-f73a48cbb21605bded9e78df1c74d8af108290a1.tar.bz2 |
Issue 26912: fix broken imports in test_email package.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_email/test_asian_codecs.py | 6 | ||||
-rw-r--r-- | Lib/test/test_email/torture_test.py | 15 |
2 files changed, 9 insertions, 12 deletions
diff --git a/Lib/test/test_email/test_asian_codecs.py b/Lib/test/test_email/test_asian_codecs.py index 089269f..f9cd7d9 100644 --- a/Lib/test/test_email/test_asian_codecs.py +++ b/Lib/test/test_email/test_asian_codecs.py @@ -5,7 +5,7 @@ import unittest from test.support import run_unittest -from test.test_email.test_email import TestEmailBase +from test.test_email import TestEmailBase from email.charset import Charset from email.header import Header, decode_header from email.message import Message @@ -18,7 +18,7 @@ except LookupError: raise unittest.SkipTest - + class TestEmailAsianCodecs(TestEmailBase): def test_japanese_codecs(self): eq = self.ndiffAssertEqual @@ -77,6 +77,6 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= self.assertEqual(jhello, ustr) - + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_email/torture_test.py b/Lib/test/test_email/torture_test.py index 19cf64f..e72a146 100644 --- a/Lib/test/test_email/torture_test.py +++ b/Lib/test/test_email/torture_test.py @@ -10,10 +10,9 @@ import sys import os import unittest from io import StringIO -from types import ListType -from email.test.test_email import TestEmailBase -from test.support import TestSkipped, run_unittest +from test.test_email import TestEmailBase +from test.support import run_unittest import email from email import __file__ as testfile @@ -28,10 +27,10 @@ def openfile(filename): try: openfile('crispin-torture.txt') except OSError: - raise TestSkipped + raise unittest.SkipTest + - class TortureBase(TestEmailBase): def _msgobj(self, filename): fp = openfile(filename) @@ -42,7 +41,7 @@ class TortureBase(TestEmailBase): return msg - + class TestCrispinTorture(TortureBase): # Mark Crispin's torture test from the SquirrelMail project def test_mondo_message(self): @@ -50,7 +49,7 @@ class TestCrispinTorture(TortureBase): neq = self.ndiffAssertEqual msg = self._msgobj('crispin-torture.txt') payload = msg.get_payload() - eq(type(payload), ListType) + eq(type(payload), list) eq(len(payload), 12) eq(msg.preamble, None) eq(msg.epilogue, '\n') @@ -113,7 +112,6 @@ multipart/mixed audio/x-sun """) - def _testclasses(): mod = sys.modules[__name__] return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')] @@ -131,6 +129,5 @@ def test_main(): run_unittest(testclass) - if __name__ == '__main__': unittest.main(defaultTest='suite') |