summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-08-08 22:25:46 (GMT)
committerGitHub <noreply@github.com>2019-08-08 22:25:46 (GMT)
commitaa542c2cf26c5af9298dda6064576b18906cdfbf (patch)
tree257dc64bf89c8f100dda7613762b3f6b550ead4e /Lib/test/test_httplib.py
parent10a0a093231ea82a3bfd33fd63322aebd8406866 (diff)
downloadcpython-aa542c2cf26c5af9298dda6064576b18906cdfbf.zip
cpython-aa542c2cf26c5af9298dda6064576b18906cdfbf.tar.gz
cpython-aa542c2cf26c5af9298dda6064576b18906cdfbf.tar.bz2
bpo-37795: Capture DeprecationWarnings in the test suite (GH-15184)
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 9148169..656932f 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -7,6 +7,7 @@ import array
import re
import socket
import threading
+import warnings
import unittest
TestCase = unittest.TestCase
@@ -1759,8 +1760,11 @@ class HTTPSTest(TestCase):
self.assertIs(h._context, context)
self.assertFalse(h._context.post_handshake_auth)
- h = client.HTTPSConnection('localhost', 443, context=context,
- cert_file=CERT_localhost)
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', 'key_file, cert_file and check_hostname are deprecated',
+ DeprecationWarning)
+ h = client.HTTPSConnection('localhost', 443, context=context,
+ cert_file=CERT_localhost)
self.assertTrue(h._context.post_handshake_auth)