diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-10-31 17:15:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-10-31 17:15:42 (GMT) |
commit | d094efd8b753a0b9cedfe07af6b5185d59de2797 (patch) | |
tree | 5bc261e5e6e8c5d1981d6e7f59755a23d461e04b | |
parent | 076ed00003ef0d94871d9dc070ae42c854a89718 (diff) | |
download | cpython-d094efd8b753a0b9cedfe07af6b5185d59de2797.zip cpython-d094efd8b753a0b9cedfe07af6b5185d59de2797.tar.gz cpython-d094efd8b753a0b9cedfe07af6b5185d59de2797.tar.bz2 |
cleanup resources in test_smtplib #10264
-rw-r--r-- | 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 index 230899b..91a9d81 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -487,6 +487,7 @@ class SMTPSimTests(unittest.TestCase): expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) + smtp.close() # SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they # require a synchronous read to obtain the credentials...so instead smtpd @@ -503,6 +504,7 @@ class SMTPSimTests(unittest.TestCase): except smtplib.SMTPAuthenticationError as err: if sim_auth_login_password not in str(err): raise "expected encoded password not found in error message" + smtp.close() def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") @@ -512,6 +514,7 @@ class SMTPSimTests(unittest.TestCase): except smtplib.SMTPAuthenticationError as err: if sim_auth_credentials['cram-md5'] not in str(err): raise "expected encoded credentials not found in error message" + smtp.close() #TODO: add tests for correct AUTH method fallback now that the #test infrastructure can support it. |