Issue #27107: Add exception classes to mailbox.__all__, by Jacek Kołodziej

This commit is contained in:
Martin Panter 2016-06-06 01:56:09 +00:00
parent 1cd2772246
commit ed84ab3335
2 changed files with 11 additions and 4 deletions

View File

@ -23,9 +23,10 @@ try:
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')

View File

@ -2268,12 +2268,18 @@ Gregory K. Johnson
""")
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()