[Python-checkins] cpython (merge 3.2 -> 3.3): Merge: #5713: fix timing issue in smtplib tests.

r.david.murray python-checkins at python.org
Thu Mar 21 02:56:35 CET 2013


http://hg.python.org/cpython/rev/0de74602692f
changeset: 82856:0de74602692f
branch: 3.3
parent: 82853:4f99a4337cea
parent: 82855:fbf54209de75
user: R David Murray <rdmurray at bitdance.com>
date: Wed Mar 20 21:55:14 2013 -0400
summary:
 Merge: #5713: fix timing issue in smtplib tests.
files:
 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
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -848,6 +848,7 @@
 # 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')
@@ -856,6 +857,7 @@
 
 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')
@@ -872,6 +874,7 @@
 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 at foo.org', ['Sally at foo.org'], 'test message')
 self.assertIsNone(smtp.sock)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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