diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-03-21 01:56:03 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-03-21 01:56:03 (GMT) |
commit | ba7d9d46f23be3bdce2bf69a5e18bac1e152bb6f (patch) | |
tree | 3792ab32fb75f06db7ac919fd012d08236aeddca /Lib | |
parent | e25df59427df97c40da28ce469e1be46a2643e4a (diff) | |
parent | a686ed7d10076319007e50978f68079886a7fd4a (diff) | |
download | cpython-ba7d9d46f23be3bdce2bf69a5e18bac1e152bb6f.zip cpython-ba7d9d46f23be3bdce2bf69a5e18bac1e152bb6f.tar.gz cpython-ba7d9d46f23be3bdce2bf69a5e18bac1e152bb6f.tar.bz2 |
Merge: #5713: fix timing issue in smtplib tests.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_smtplib.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 84538fc..87a73d5 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -842,6 +842,7 @@ class SMTPSimTests(unittest.TestCase): # Issue 5713: make sure close, not rset, is called if we get a 421 error def test_421_from_mail_cmd(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + smtp.noop() self.serv._SMTPchannel.mail_response = '421 closing connection' with self.assertRaises(smtplib.SMTPSenderRefused): smtp.sendmail('John', 'Sally', 'test message') @@ -850,6 +851,7 @@ class SMTPSimTests(unittest.TestCase): def test_421_from_rcpt_cmd(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + smtp.noop() self.serv._SMTPchannel.rcpt_response = ['250 accepted', '421 closing'] with self.assertRaises(smtplib.SMTPRecipientsRefused) as r: smtp.sendmail('John', ['Sally', 'Frank', 'George'], 'test message') @@ -866,6 +868,7 @@ class SMTPSimTests(unittest.TestCase): super().found_terminator() self.serv.channel_class = MySimSMTPChannel smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + smtp.noop() with self.assertRaises(smtplib.SMTPDataError): smtp.sendmail('John@foo.org', ['Sally@foo.org'], 'test message') self.assertIsNone(smtp.sock) |