Provide a little better debug output (GH-6940) (#6942)

(cherry picked from commit 273f51f5ca)

Co-authored-by: Barry Warsaw <barry@python.org>
This commit is contained in:
Miss Islington (bot) 2018-05-17 09:53:24 -07:00 committed by Barry Warsaw
parent 6417d33633
commit 56882db4f7
1 changed files with 1 additions and 1 deletions

View File

@ -893,7 +893,7 @@ class GeneralModuleTests(unittest.TestCase):
) )
for addr in ['0.1.1.~1', '1+.1.1.1', '::1q', '::1::2', for addr in ['0.1.1.~1', '1+.1.1.1', '::1q', '::1::2',
'1:1:1:1:1:1:1:1:1']: '1:1:1:1:1:1:1:1:1']:
with self.assertRaises(OSError): with self.assertRaises(OSError, msg=addr):
socket.gethostbyname(addr) socket.gethostbyname(addr)
with self.assertRaises(OSError, msg=explanation): with self.assertRaises(OSError, msg=explanation):
socket.gethostbyaddr(addr) socket.gethostbyaddr(addr)