MCPcopy Index your code
hub / github.com/python/cpython / test_with_statement

Method test_with_statement

Lib/test/test_smtplib.py:1268–1275  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1266 smtp.quit()
1267
1268 def test_with_statement(self):
1269 with smtplib.SMTP(HOST, self.port) as smtp:
1270 code, message = smtp.noop()
1271 self.assertEqual(code, 250)
1272 self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, b'foo')
1273 with smtplib.SMTP(HOST, self.port) as smtp:
1274 smtp.close()
1275 self.assertRaises(smtplib.SMTPServerDisconnected, smtp.send, b'foo')
1276
1277 def test_with_statement_QUIT_failure(self):
1278 with self.assertRaises(smtplib.SMTPResponseException) as error:

Callers

nothing calls this directly

Calls 4

noopMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected