From 6a396c9807b1674a24e240731f18e20de97117a5 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 14 Sep 2017 17:54:09 -0400 Subject: bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011) New -n flag allow overriding localhost with custom value, for example to run from containers. --- Lib/test/test_pydoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_pydoc.py') diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 1ac08edb48..52830b49ae 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -909,8 +909,8 @@ class PydocServerTest(unittest.TestCase): text = 'the URL sent was: (%s, %s)' % (url, content_type) return text - serverthread = pydoc._start_server(my_url_handler, port=0) - self.assertIn('localhost', serverthread.docserver.address) + serverthread = pydoc._start_server(my_url_handler, hostname='0.0.0.0', port=0) + self.assertIn('0.0.0.0', serverthread.docserver.address) starttime = time.time() timeout = 1 #seconds -- cgit v1.2.1