Provide a little better debug output (GH-6940) (#6942)
(cherry picked from commit 273f51f5ca9dd0420d327c95281b24078f8feeef)
Co-authored-by: Barry Warsaw <barry@python.org>
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 44501d9..f377ebc 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -893,7 +893,7 @@
)
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)