From 34dbc1e75d30510b06918714433562bd0138e2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Mon, 25 Mar 2024 10:00:12 +0545 Subject: [PATCH] fix celery-types, flaky tests --- pyproject.toml | 3 ++- tests/worker/test_temporary.py | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f60a0d1..d3107ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,8 @@ tests = [ ] dev = [ "dvc-task[tests,docs]", - "celery-types", + "celery-types; python_version > '3.9'", + "celery-types==0.15.0; python_version < '3.9'", "mypy==1.9.0" ] diff --git a/tests/worker/test_temporary.py b/tests/worker/test_temporary.py index 66dd518..2ff7166 100644 --- a/tests/worker/test_temporary.py +++ b/tests/worker/test_temporary.py @@ -28,10 +28,7 @@ def test_start(celery_app: Celery, mocker: MockerFixture): thread.assert_called_once_with(target=worker.monitor, daemon=True, args=(name,)) -@pytest.mark.flaky( - max_runs=3, - rerun_filter=lambda *args: sys.platform == "darwin", -) +@pytest.mark.flaky(reruns=3, condition=sys.platform == "darwin") def test_start_already_exists( celery_app: Celery, celery_worker: WorkController, @@ -46,10 +43,7 @@ def test_start_already_exists( thread.assert_not_called() -@pytest.mark.flaky( - max_runs=3, - rerun_filter=lambda *args: sys.platform == "darwin", -) +@pytest.mark.flaky(reruns=3, condition=sys.platform == "darwin") def test_monitor( celery_app: Celery, celery_worker: WorkController,