diff options
Diffstat (limited to 'tests/gunicorn_utils.py')
-rw-r--r-- | tests/gunicorn_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/gunicorn_utils.py b/tests/gunicorn_utils.py index f5dae7a..5c077aa 100644 --- a/tests/gunicorn_utils.py +++ b/tests/gunicorn_utils.py @@ -29,12 +29,14 @@ class _StandaloneApplication(WSGIApplication): def _proc_target(config_path: str, event: multiprocessing.Event, **kwargs) -> None: """Run a Gunicorn app with the given config and set `event` when Gunicorn is ready.""" + def when_ready(_): event.set() app = _StandaloneApplication(config_path, when_ready=when_ready, **kwargs) import logging + logging.disable(logging.INFO) app.run() @@ -62,7 +64,7 @@ def run_gunicorn(config_path: str = "config/gunicorn.conf.py", **kwargs) -> Iter concurrent.futures.wait( [executor.submit(proc.join), executor.submit(event.wait)], timeout=60, - return_when=concurrent.futures.FIRST_COMPLETED + return_when=concurrent.futures.FIRST_COMPLETED, ) # Can't use the context manager cause wait=False needs to be set. executor.shutdown(wait=False, cancel_futures=True) |