mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Fix reversed assertRegex checks in test_ssl. (#117351)
This commit is contained in:
		
							parent
							
								
									8eec7ed714
								
							
						
					
					
						commit
						2e9be80c99
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -3867,7 +3867,7 @@ def test_min_max_version_mismatch(self):
 | 
				
			||||||
                                            server_hostname=hostname) as s:
 | 
					                                            server_hostname=hostname) as s:
 | 
				
			||||||
                with self.assertRaises(ssl.SSLError) as e:
 | 
					                with self.assertRaises(ssl.SSLError) as e:
 | 
				
			||||||
                    s.connect((HOST, server.port))
 | 
					                    s.connect((HOST, server.port))
 | 
				
			||||||
                self.assertRegex("(alert|ALERT)", str(e.exception))
 | 
					                self.assertRegex(str(e.exception), "(alert|ALERT)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @requires_tls_version('SSLv3')
 | 
					    @requires_tls_version('SSLv3')
 | 
				
			||||||
    def test_min_max_version_sslv3(self):
 | 
					    def test_min_max_version_sslv3(self):
 | 
				
			||||||
| 
						 | 
					@ -4182,7 +4182,7 @@ def cb_raising(ssl_sock, server_name, initial_context):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Allow for flexible libssl error messages.
 | 
					            # Allow for flexible libssl error messages.
 | 
				
			||||||
            regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
 | 
					            regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
 | 
				
			||||||
            self.assertRegex(regex, cm.exception.reason)
 | 
					            self.assertRegex(cm.exception.reason, regex)
 | 
				
			||||||
            self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
 | 
					            self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_sni_callback_wrong_return_type(self):
 | 
					    def test_sni_callback_wrong_return_type(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue