From 0affe13e38ef097b99c7b4ae0e228a3500af2a02 Mon Sep 17 00:00:00 2001 From: Tomer Nosrati Date: Sat, 10 Aug 2024 23:44:06 +0300 Subject: [PATCH] Use set instead of list with ALL_CELERY_BROKERS and ALL_CELERY_BACKENDS (#375) --- src/pytest_celery/defaults.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pytest_celery/defaults.py b/src/pytest_celery/defaults.py index 98f05198..a8544436 100644 --- a/src/pytest_celery/defaults.py +++ b/src/pytest_celery/defaults.py @@ -38,20 +38,20 @@ # Tests that do not rely on default parametrization will not be affected. -ALL_CELERY_BACKENDS = [] -ALL_CELERY_BROKERS = [] +ALL_CELERY_BACKENDS = set() +ALL_CELERY_BROKERS = set() if _is_vendor_installed("redis"): - ALL_CELERY_BACKENDS.append(CELERY_REDIS_BACKEND) - ALL_CELERY_BROKERS.append(CELERY_REDIS_BROKER) + ALL_CELERY_BACKENDS.add(CELERY_REDIS_BACKEND) + ALL_CELERY_BROKERS.add(CELERY_REDIS_BROKER) if _is_vendor_installed("rabbitmq"): # Uses Kombu - ALL_CELERY_BROKERS.append(CELERY_RABBITMQ_BROKER) + ALL_CELERY_BROKERS.add(CELERY_RABBITMQ_BROKER) # Memcached is disabled by default regardless of its availability due to its experimental status. if _is_vendor_installed("memcached") and False: - ALL_CELERY_BACKENDS.append(CELERY_MEMCACHED_BACKEND) + ALL_CELERY_BACKENDS.add(CELERY_MEMCACHED_BACKEND) # Worker setup is assumed to be always available. ALL_CELERY_WORKERS = (CELERY_SETUP_WORKER,)