diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 44501d922ad..f377ebcb27b 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -893,7 +893,7 @@ class GeneralModuleTests(unittest.TestCase): ) for addr in ['0.1.1.~1', '1+.1.1.1', '::1q', '::1::2', '1:1:1:1:1:1:1:1:1']: - with self.assertRaises(OSError): + with self.assertRaises(OSError, msg=addr): socket.gethostbyname(addr) with self.assertRaises(OSError, msg=explanation): socket.gethostbyaddr(addr)