From eb3d78f687c3330e370927d5b020498ede2de4d1 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:26:28 -0700 Subject: [PATCH] Fix test_fast when there's only one CPU (#2801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com> Co-authored-by: Adam Hopkins --- tests/test_prepare.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_prepare.py b/tests/test_prepare.py index b1b35f19..79786964 100644 --- a/tests/test_prepare.py +++ b/tests/test_prepare.py @@ -76,4 +76,10 @@ def test_fast(app: Sanic, caplog): assert app.state.workers == workers messages = [m[2] for m in caplog.record_tuples] - assert f"mode: production, goin' fast w/ {workers} workers" in messages + + if workers == 1: + worker_fragment = "single worker" + else: + worker_fragment = f"w/ {workers} workers" + + assert f"mode: production, goin' fast {worker_fragment}" in messages