mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-15 05:52:57 +00:00
Choose random host port in tests
This commit is contained in:
@@ -51,6 +51,7 @@ def test_start_notebook(
|
||||
tty=True,
|
||||
environment=env,
|
||||
command=["start-notebook.sh"],
|
||||
ports={"8888/tcp": None},
|
||||
)
|
||||
# sleeping some time to let the server start
|
||||
time.sleep(3)
|
||||
@@ -68,7 +69,8 @@ def test_start_notebook(
|
||||
assert len(expected_warnings) == len(warnings)
|
||||
# checking if the server is listening
|
||||
if expected_start:
|
||||
resp = http_client.get("http://localhost:8888")
|
||||
host_port = container.get_host_port("8888/tcp")
|
||||
resp = http_client.get("http://localhost:" + host_port)
|
||||
assert resp.status_code == 200, "Server is not listening"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user