[Python-checkins] cpython: Issue #27107: Add exception classes to mailbox.__all__, by Jacek Kołodziej

martin.panter python-checkins at python.org
Sun Jun 5 22:30:49 EDT 2016


https://hg.python.org/cpython/rev/4705b7597c86
changeset: 101762:4705b7597c86
user: Martin Panter <vadmium+py at gmail.com>
date: Mon Jun 06 01:56:09 2016 +0000
summary:
 Issue #27107: Add exception classes to mailbox.__all__, by Jacek Kołodziej
files:
 Lib/mailbox.py | 7 ++++---
 Lib/test/test_mailbox.py | 8 +++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -23,9 +23,10 @@
 except ImportError:
 fcntl = None
 
-__all__ = [ 'Mailbox', 'Maildir', 'mbox', 'MH', 'Babyl', 'MMDF',
- 'Message', 'MaildirMessage', 'mboxMessage', 'MHMessage',
- 'BabylMessage', 'MMDFMessage']
+__all__ = ['Mailbox', 'Maildir', 'mbox', 'MH', 'Babyl', 'MMDF',
+ 'Message', 'MaildirMessage', 'mboxMessage', 'MHMessage',
+ 'BabylMessage', 'MMDFMessage', 'Error', 'NoSuchMailboxError',
+ 'NotEmptyError', 'ExternalClashError', 'FormatError']
 
 linesep = os.linesep.encode('ascii')
 
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -2268,12 +2268,18 @@
 """)
 
 
+class MiscTestCase(unittest.TestCase):
+ def test__all__(self):
+ blacklist = {"linesep"}
+ support.check__all__(self, mailbox, blacklist=blacklist)
+
+
 def test_main():
 tests = (TestMailboxSuperclass, TestMaildir, TestMbox, TestMMDF, TestMH,
 TestBabyl, TestMessage, TestMaildirMessage, TestMboxMessage,
 TestMHMessage, TestBabylMessage, TestMMDFMessage,
 TestMessageConversion, TestProxyFile, TestPartialFile,
- MaildirTestCase, TestFakeMailBox)
+ MaildirTestCase, TestFakeMailBox, MiscTestCase)
 support.run_unittest(*tests)
 support.reap_children()
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /