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

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


http://hg.python.org/cpython/rev/6dc948e4ea8f
changeset: 82857:6dc948e4ea8f
parent: 82854:d3d170d32533
parent: 82856:0de74602692f
user: R David Murray <rdmurray at bitdance.com>
date: Wed Mar 20 21:56:03 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
@@ -842,6 +842,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')
@@ -850,6 +851,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')
@@ -866,6 +868,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 によって変換されたページ (->オリジナル) /