aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gunicorn_utils.py
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2022-06-04 12:49:47 -0700
committerGravatar GitHub <[email protected]>2022-06-04 12:49:47 -0700
commit2759fd453f5977f027a10cc672fed630ecc7de6c (patch)
treeecaa6114606415e3b95ba707661d70a1cb87fd90 /tests/gunicorn_utils.py
parentMerge pull request #143 from python-discord/feat/tests/wsgi-app-from-cfg (diff)
parentCI: use GH's Ubuntu 22.04 runner instead of the self-hosted one (diff)
Merge #144 - add black and isort
Diffstat (limited to 'tests/gunicorn_utils.py')
-rw-r--r--tests/gunicorn_utils.py4
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)