From 36ef10c4f8eed2bbaaebfe59aced67068d96b25a Mon Sep 17 00:00:00 2001 From: Carlo Bertini Date: Sun, 3 Dec 2023 18:45:10 +0100 Subject: [PATCH] chore: fix test --- tests/conftest.py | 19 +++++++++---------- tests/test_pubsub.py | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0801200..2d443b9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,7 +22,6 @@ from celery import Task from celery_pubsub import subscribe, subscribe_to -from celery_pubsub import subscribe from pkg_resources import get_distribution, parse_version P = ParamSpec("P") @@ -136,22 +135,22 @@ def job(*args: P.args, **kwargs: P.kwargs) -> str: @pytest.fixture(scope="session") -def job_l() -> Task[P, str]: +def job_j() -> Task[P, str]: @subscribe_to(topic="foo.bar.baz") - @task(name="job_l") + @task(name="job_j") def job(*args: P.args, **kwargs: P.kwargs) -> str: - print(f"job_l: {args} {kwargs}") - return "l" + print(f"job_j: {args} {kwargs}") + return "j" return job @pytest.fixture(scope="session") -def job_m() -> Task[P, str]: +def job_k() -> Task[P, str]: @subscribe_to(topic="foo.bar") def job(*args: P.args, **kwargs: P.kwargs) -> str: - print(f"job_m: {args} {kwargs}") - return "m" + print(f"job_k: {args} {kwargs}") + return "k" return job @@ -167,8 +166,8 @@ def subscriber( job_g: Task[P, str], job_h: Task[P, str], job_i: Task[P, str], - job_l: Task[P, str], - job_m: Task[P, str], + job_j: Task[P, str], + job_k: Task[P, str], ) -> None: subscribe("index.high", job_a) subscribe("index.low", job_b) diff --git a/tests/test_pubsub.py b/tests/test_pubsub.py index ea81620..07a8707 100644 --- a/tests/test_pubsub.py +++ b/tests/test_pubsub.py @@ -98,14 +98,14 @@ def test_10(celery_worker: WorkController) -> None: from celery_pubsub import publish res = publish("foo.bar.baz", 4, 8, a15=16, a23=42).get() - assert sorted(res) == sorted(["e", "h", "l"]) + assert sorted(res) == sorted(["e", "h", "j"]) def test_11(celery_worker: WorkController) -> None: from celery_pubsub import publish res = publish("foo.bar", 4, 8, a15=16, a23=42).get() - assert sorted(res) == sorted(["e", "h", "m"]) + assert sorted(res) == sorted(["e", "h", "k"]) def test_subscription_redundant(