2828
2929from ssl import TLSVersion , _TLSContentType , _TLSMessageType , _TLSAlertType
3030
31+ Py_DEBUG = hasattr (sys , 'gettotalrefcount' )
32+ Py_DEBUG_WIN32 = Py_DEBUG and sys .platform == 'win32'
33+
3134PROTOCOLS = sorted (ssl ._PROTOCOL_NAMES )
3235HOST = support .HOST
3336IS_LIBRESSL = ssl .OPENSSL_VERSION .startswith ('LibreSSL' )
@@ -1347,6 +1350,7 @@ def test_load_verify_cadata(self):
13471350 ctx .load_verify_locations (cadata = b"broken" )
13481351
13491352
1353+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
13501354 def test_load_dh_params (self ):
13511355 ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_SERVER )
13521356 ctx .load_dh_params (DHFILE )
@@ -1665,6 +1669,7 @@ def test_str(self):
16651669 self .assertEqual (str (e ), "foo" )
16661670 self .assertEqual (e .errno , 1 )
16671671
1672+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
16681673 def test_lib_reason (self ):
16691674 # Test the library and reason attributes
16701675 ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
@@ -3845,6 +3850,7 @@ def test_compression_disabled(self):
38453850 sni_name = hostname )
38463851 self .assertIs (stats ['compression' ], None )
38473852
3853+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
38483854 def test_dh_params (self ):
38493855 # Check we can get a connection with ephemeral Diffie-Hellman
38503856 client_context , server_context , hostname = testing_context ()
@@ -4440,6 +4446,7 @@ def keylog_lines(self, fname=support.TESTFN):
44404446 return len (list (f ))
44414447
44424448 @requires_keylog
4449+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
44434450 def test_keylog_defaults (self ):
44444451 self .addCleanup (support .unlink , support .TESTFN )
44454452 ctx = ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
@@ -4463,6 +4470,7 @@ def test_keylog_defaults(self):
44634470 ctx .keylog_filename = 1
44644471
44654472 @requires_keylog
4473+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
44664474 def test_keylog_filename (self ):
44674475 self .addCleanup (support .unlink , support .TESTFN )
44684476 client_context , server_context , hostname = testing_context ()
@@ -4500,6 +4508,7 @@ def test_keylog_filename(self):
45004508 @requires_keylog
45014509 @unittest .skipIf (sys .flags .ignore_environment ,
45024510 "test is not compatible with ignore_environment" )
4511+ @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" )
45034512 def test_keylog_env (self ):
45044513 self .addCleanup (support .unlink , support .TESTFN )
45054514 with unittest .mock .patch .dict (os .environ ):
0 commit comments