Skip to content

Commit 0affe13

Browse files
authored
Use set instead of list with ALL_CELERY_BROKERS and ALL_CELERY_BACKENDS (#375)
1 parent 80c86ee commit 0affe13

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pytest_celery/defaults.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@
3838
# Tests that do not rely on default parametrization will not be affected.
3939

4040

41-
ALL_CELERY_BACKENDS = []
42-
ALL_CELERY_BROKERS = []
41+
ALL_CELERY_BACKENDS = set()
42+
ALL_CELERY_BROKERS = set()
4343

4444
if _is_vendor_installed("redis"):
45-
ALL_CELERY_BACKENDS.append(CELERY_REDIS_BACKEND)
46-
ALL_CELERY_BROKERS.append(CELERY_REDIS_BROKER)
45+
ALL_CELERY_BACKENDS.add(CELERY_REDIS_BACKEND)
46+
ALL_CELERY_BROKERS.add(CELERY_REDIS_BROKER)
4747

4848
if _is_vendor_installed("rabbitmq"):
4949
# Uses Kombu
50-
ALL_CELERY_BROKERS.append(CELERY_RABBITMQ_BROKER)
50+
ALL_CELERY_BROKERS.add(CELERY_RABBITMQ_BROKER)
5151

5252
# Memcached is disabled by default regardless of its availability due to its experimental status.
5353
if _is_vendor_installed("memcached") and False:
54-
ALL_CELERY_BACKENDS.append(CELERY_MEMCACHED_BACKEND)
54+
ALL_CELERY_BACKENDS.add(CELERY_MEMCACHED_BACKEND)
5555

5656
# Worker setup is assumed to be always available.
5757
ALL_CELERY_WORKERS = (CELERY_SETUP_WORKER,)

0 commit comments

Comments
 (0)