Skip to content

Commit 1122236

Browse files
committed
increase test_smtplib timeouts
1 parent daf82f7 commit 1122236

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/test/test_smtplib.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,31 +179,31 @@ def tearDown(self):
179179

180180
def testBasic(self):
181181
# connect
182-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
182+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
183183
smtp.quit()
184184

185185
def testNOOP(self):
186-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
186+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
187187
expected = (250, 'Ok')
188188
self.assertEqual(smtp.noop(), expected)
189189
smtp.quit()
190190

191191
def testRSET(self):
192-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
192+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
193193
expected = (250, 'Ok')
194194
self.assertEqual(smtp.rset(), expected)
195195
smtp.quit()
196196

197197
def testNotImplemented(self):
198198
# EHLO isn't implemented in DebuggingServer
199-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
199+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
200200
expected = (502, 'Error: command "EHLO" not implemented')
201201
self.assertEqual(smtp.ehlo(), expected)
202202
smtp.quit()
203203

204204
def testVRFY(self):
205205
# VRFY isn't implemented in DebuggingServer
206-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
206+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
207207
expected = (502, 'Error: command "VRFY" not implemented')
208208
self.assertEqual(smtp.vrfy('nobody@nowhere.com'), expected)
209209
self.assertEqual(smtp.verify('nobody@nowhere.com'), expected)
@@ -212,21 +212,21 @@ def testVRFY(self):
212212
def testSecondHELO(self):
213213
# check that a second HELO returns a message that it's a duplicate
214214
# (this behavior is specific to smtpd.SMTPChannel)
215-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
215+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
216216
smtp.helo()
217217
expected = (503, 'Duplicate HELO/EHLO')
218218
self.assertEqual(smtp.helo(), expected)
219219
smtp.quit()
220220

221221
def testHELP(self):
222-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
222+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
223223
self.assertEqual(smtp.help(), 'Error: command "HELP" not implemented')
224224
smtp.quit()
225225

226226
def testSend(self):
227227
# connect and send mail
228228
m = 'A test message'
229-
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
229+
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
230230
smtp.sendmail('John', 'Sally', m)
231231
# XXX(nnorwitz): this test is flaky and dies with a bad file descriptor
232232
# in asyncore. This sleep might help, but should really be fixed

0 commit comments

Comments
 (0)