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,)