Skip to content

Commit

Permalink
Use set instead of list with ALL_CELERY_BROKERS and ALL_CELERY_BACKEN…
Browse files Browse the repository at this point in the history
…DS (#375)
  • Loading branch information
Nusnus authored Aug 10, 2024
1 parent 80c86ee commit 0affe13
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pytest_celery/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
Expand Down

0 comments on commit 0affe13

Please sign in to comment.