https://github.com/python/cpython/commit/56882db4f7e7ee14ed37d5234c8a06a5a50a7593 commit: 56882db4f7e7ee14ed37d5234c8a06a5a50a7593 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: Barry Warsaw <barry at python.org> date: 2018年05月17日T12:53:24-04:00 summary: Provide a little better debug output (GH-6940) (#6942) (cherry picked from commit 273f51f5ca9dd0420d327c95281b24078f8feeef) Co-authored-by: Barry Warsaw <barry at python.org> files: M Lib/test/test_socket.py diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 44501d922ad3..f377ebcb27b2 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -893,7 +893,7 @@ def test_host_resolution_bad_address(self): ) 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)