| 491 | self.client.stls() |
| 492 | |
| 493 | def tearDown(self): |
| 494 | if self.client.file is not None and self.client.sock is not None: |
| 495 | try: |
| 496 | self.client.quit() |
| 497 | except poplib.error_proto: |
| 498 | # happens in the test_too_long_lines case; the overlong |
| 499 | # response will be treated as response to QUIT and raise |
| 500 | # this exception |
| 501 | self.client.close() |
| 502 | self.server.stop() |
| 503 | # Explicitly clear the attribute to prevent dangling thread |
| 504 | self.server = None |
| 505 | |
| 506 | def test_stls(self): |
| 507 | self.assertRaises(poplib.error_proto, self.client.stls) |