@@ -1348,10 +1348,14 @@ def test_load_verify_cadata(self):
13481348        with  self .assertRaises (ssl .SSLError ):
13491349            ctx .load_verify_locations (cadata = cacert_der  +  b"A" )
13501350
1351-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
13521351    def  test_load_dh_params (self ):
13531352        ctx  =  ssl .SSLContext (ssl .PROTOCOL_TLS_SERVER )
1354-         ctx .load_dh_params (DHFILE )
1353+         try :
1354+             ctx .load_dh_params (DHFILE )
1355+         except  RuntimeError :
1356+             if  Py_DEBUG_WIN32 :
1357+                 self .skipTest ("not supported on Win32 debug build" )
1358+             raise 
13551359        if  os .name  !=  'nt' :
13561360            ctx .load_dh_params (BYTES_DHFILE )
13571361        self .assertRaises (TypeError , ctx .load_dh_params )
@@ -1676,12 +1680,17 @@ def test_str(self):
16761680        self .assertEqual (str (e ), "foo" )
16771681        self .assertEqual (e .errno , 1 )
16781682
1679-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
16801683    def  test_lib_reason (self ):
16811684        # Test the library and reason attributes 
16821685        ctx  =  ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
1683-         with  self .assertRaises (ssl .SSLError ) as  cm :
1684-             ctx .load_dh_params (CERTFILE )
1686+         try :
1687+             with  self .assertRaises (ssl .SSLError ) as  cm :
1688+                 ctx .load_dh_params (CERTFILE )
1689+         except  RuntimeError :
1690+             if  Py_DEBUG_WIN32 :
1691+                 self .skipTest ("not supported on Win32 debug build" )
1692+             raise 
1693+ 
16851694        self .assertEqual (cm .exception .library , 'PEM' )
16861695        regex  =  "(NO_START_LINE|UNSUPPORTED_PUBLIC_KEY_TYPE)" 
16871696        self .assertRegex (cm .exception .reason , regex )
@@ -4060,13 +4069,17 @@ def test_no_legacy_server_connect(self):
40604069                                   chatty = True , connectionchatty = True ,
40614070                                   sni_name = hostname )
40624071
4063-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
40644072    def  test_dh_params (self ):
40654073        # Check we can get a connection with ephemeral Diffie-Hellman 
40664074        client_context , server_context , hostname  =  testing_context ()
40674075        # test scenario needs TLS <= 1.2 
40684076        client_context .maximum_version  =  ssl .TLSVersion .TLSv1_2 
4069-         server_context .load_dh_params (DHFILE )
4077+         try :
4078+             server_context .load_dh_params (DHFILE )
4079+         except  RuntimeError :
4080+             if  Py_DEBUG_WIN32 :
4081+                 self .skipTest ("not supported on Win32 debug build" )
4082+             raise 
40704083        server_context .set_ciphers ("kEDH" )
40714084        server_context .maximum_version  =  ssl .TLSVersion .TLSv1_2 
40724085        stats  =  server_params_test (client_context , server_context ,
@@ -4846,14 +4859,18 @@ def keylog_lines(self, fname=os_helper.TESTFN):
48464859            return  len (list (f ))
48474860
48484861    @requires_keylog  
4849-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
48504862    def  test_keylog_defaults (self ):
48514863        self .addCleanup (os_helper .unlink , os_helper .TESTFN )
48524864        ctx  =  ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
48534865        self .assertEqual (ctx .keylog_filename , None )
48544866
48554867        self .assertFalse (os .path .isfile (os_helper .TESTFN ))
4856-         ctx .keylog_filename  =  os_helper .TESTFN 
4868+         try :
4869+             ctx .keylog_filename  =  os_helper .TESTFN 
4870+         except  RuntimeError :
4871+             if  Py_DEBUG_WIN32 :
4872+                 self .skipTest ("not supported on Win32 debug build" )
4873+             raise 
48574874        self .assertEqual (ctx .keylog_filename , os_helper .TESTFN )
48584875        self .assertTrue (os .path .isfile (os_helper .TESTFN ))
48594876        self .assertEqual (self .keylog_lines (), 1 )
@@ -4870,12 +4887,17 @@ def test_keylog_defaults(self):
48704887            ctx .keylog_filename  =  1 
48714888
48724889    @requires_keylog  
4873-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
48744890    def  test_keylog_filename (self ):
48754891        self .addCleanup (os_helper .unlink , os_helper .TESTFN )
48764892        client_context , server_context , hostname  =  testing_context ()
48774893
4878-         client_context .keylog_filename  =  os_helper .TESTFN 
4894+         try :
4895+             client_context .keylog_filename  =  os_helper .TESTFN 
4896+         except  RuntimeError :
4897+             if  Py_DEBUG_WIN32 :
4898+                 self .skipTest ("not supported on Win32 debug build" )
4899+             raise 
4900+ 
48794901        server  =  ThreadedEchoServer (context = server_context , chatty = False )
48804902        with  server :
48814903            with  client_context .wrap_socket (socket .socket (),
@@ -4908,7 +4930,6 @@ def test_keylog_filename(self):
49084930    @requires_keylog  
49094931    @unittest .skipIf (sys .flags .ignore_environment , 
49104932                     "test is not compatible with ignore_environment" ) 
4911-     @unittest .skipIf (Py_DEBUG_WIN32 , "Avoid mixing debug/release CRT on Windows" ) 
49124933    def  test_keylog_env (self ):
49134934        self .addCleanup (os_helper .unlink , os_helper .TESTFN )
49144935        with  unittest .mock .patch .dict (os .environ ):
@@ -4918,7 +4939,12 @@ def test_keylog_env(self):
49184939            ctx  =  ssl .SSLContext (ssl .PROTOCOL_TLS_CLIENT )
49194940            self .assertEqual (ctx .keylog_filename , None )
49204941
4921-             ctx  =  ssl .create_default_context ()
4942+             try :
4943+                 ctx  =  ssl .create_default_context ()
4944+             except  RuntimeError :
4945+                 if  Py_DEBUG_WIN32 :
4946+                     self .skipTest ("not supported on Win32 debug build" )
4947+                 raise 
49224948            self .assertEqual (ctx .keylog_filename , os_helper .TESTFN )
49234949
49244950            ctx  =  ssl ._create_stdlib_context ()
0 commit comments