aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorFeanil Patel <feanil@edx.org>2017-09-14 17:54:09 -0400
committerÉric Araujo <merwok@users.noreply.github.com>2017-09-14 17:54:09 -0400
commit6a396c9807b1674a24e240731f18e20de97117a5 (patch)
tree4c91775a0ed65e0d12e13f3a90e01cfdac639e98 /Lib/test/test_pydoc.py
parentccb3c7654cc3d031fb93bf443a6ef9cfb11f6b43 (diff)
downloadcpython-6a396c9807b1674a24e240731f18e20de97117a5.tar.gz
cpython-6a396c9807b1674a24e240731f18e20de97117a5.zip
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.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 1ac08edb48e..52830b49aea 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