summaryrefslogtreecommitdiff
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-05-16 23:21:26 +0300
committerBerker Peksag <berker.peksag@gmail.com>2015-05-16 23:21:26 +0300
commit9e7990ae21fd32b25631a23bcdb00c8a086bb0c6 (patch)
tree20abb0304f634067793d1226922adafe3c8ad378 /Lib/test/test_ssl.py
parentb744f3a45e3228ea2b344c8cf9424e2592dc93b7 (diff)
downloadcpython-git-9e7990ae21fd32b25631a23bcdb00c8a086bb0c6.tar.gz
Issue #24210: Silence more PendingDeprecationWarning warnings in tests.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 9140fc15ae..f314ff41da 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -3294,18 +3294,26 @@ else:
def test_main(verbose=False):
if support.verbose:
+ import warnings
plats = {
'Linux': platform.linux_distribution,
'Mac': platform.mac_ver,
'Windows': platform.win32_ver,
}
- for name, func in plats.items():
- plat = func()
- if plat and plat[0]:
- plat = '%s %r' % (name, plat)
- break
- else:
- plat = repr(platform.platform())
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ 'ignore',
+ 'dist\(\) and linux_distribution\(\) '
+ 'functions are deprecated .*',
+ PendingDeprecationWarning,
+ )
+ for name, func in plats.items():
+ plat = func()
+ if plat and plat[0]:
+ plat = '%s %r' % (name, plat)
+ break
+ else:
+ plat = repr(platform.platform())
print("test_ssl: testing with %r %r" %
(ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
print(" under %s" % plat)