From 9ec4e6d1d131194f299795e51a624e966056a557 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 18 Nov 2019 18:56:08 +0100 Subject: [PATCH] Add inline comment to test --- jupyterhub/tests/test_app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jupyterhub/tests/test_app.py b/jupyterhub/tests/test_app.py index 863d0e06..bc59176b 100644 --- a/jupyterhub/tests/test_app.py +++ b/jupyterhub/tests/test_app.py @@ -46,16 +46,20 @@ def test_raise_error_on_missing_specified_config(): Using the -f or --config flag when starting JupyterHub should require the file to be found and exit if it isn't. """ + # subprocess.run doesn't have a timeout flag, so if this test would fail by + # not letting jupyterhub error out, we would wait forever. subprocess.Popen + # allow us to manually timeout. process = Popen( [sys.executable, '-m', 'jupyterhub', '--config', 'not-available.py'] ) - # wait inpatiently for the process to exit + # wait inpatiently for the process to exit like we want it to for i in range(100): time.sleep(0.1) returncode = process.poll() if returncode is not None: break - process.kill() + else: + process.kill() assert returncode == 1