mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-37795: Capture DeprecationWarnings in the test suite (GH-15184)
This commit is contained in:
parent
10a0a09323
commit
aa542c2cf2
2 changed files with 11 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue