Fix test_fast when there's only one CPU (#2801)

Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
This commit is contained in:
Theodore Ni 2023-09-06 11:26:28 -07:00 committed by GitHub
parent d255d1aae1
commit eb3d78f687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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