summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-03 17:32:25 (GMT)
committerGitHub <noreply@github.com>2022-11-03 17:32:25 (GMT)
commitef0e72b31d22f780d3a165d7d0471806061fe380 (patch)
treeb6c37400400dbca49c00466290a60122b6137ae9 /Lib/test/test_ftplib.py
parent9c4ae037b9c39312b792964497c090ce01570208 (diff)
downloadcpython-ef0e72b31d22f780d3a165d7d0471806061fe380.zip
cpython-ef0e72b31d22f780d3a165d7d0471806061fe380.tar.gz
cpython-ef0e72b31d22f780d3a165d7d0471806061fe380.tar.bz2
gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173)
Remove the keyfile, certfile and check_hostname parameters, deprecated since Python 3.6, in modules: ftplib, http.client, imaplib, poplib and smtplib. Use the context parameter (ssl_context in imaplib) instead. Parameters following the removed parameters become keyword-only parameters. ftplib: Remove the FTP_TLS.ssl_version class attribute: use the context parameter instead.
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 082a90d..218fecf 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -984,11 +984,11 @@ class TestTLS_FTPClass(TestCase):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
- self.assertRaises(ValueError, ftplib.FTP_TLS, keyfile=CERTFILE,
+ self.assertRaises(TypeError, ftplib.FTP_TLS, keyfile=CERTFILE,
context=ctx)
- self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE,
+ self.assertRaises(TypeError, ftplib.FTP_TLS, certfile=CERTFILE,
context=ctx)
- self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE,
+ self.assertRaises(TypeError, ftplib.FTP_TLS, certfile=CERTFILE,
keyfile=CERTFILE, context=ctx)
self.client = ftplib.FTP_TLS(context=ctx, timeout=TIMEOUT)