(self)
| 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: |
nothing calls this directly
no test coverage detected