Skip to content

Commit

Permalink
Use set instead of list with ALL_CELERY_BROKERS and ALL_CELERY_BACKENDS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusnus committed Aug 10, 2024
1 parent 80c86ee commit 6815548
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()

Check warning on line 42 in src/pytest_celery/defaults.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/defaults.py#L41-L42

Added lines #L41 - L42 were not covered by tests

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)

Check warning on line 46 in src/pytest_celery/defaults.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/defaults.py#L45-L46

Added lines #L45 - L46 were not covered by tests

if _is_vendor_installed("rabbitmq"):
# Uses Kombu
ALL_CELERY_BROKERS.append(CELERY_RABBITMQ_BROKER)
ALL_CELERY_BROKERS.add(CELERY_RABBITMQ_BROKER)

Check warning on line 50 in src/pytest_celery/defaults.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/defaults.py#L50

Added line #L50 was not covered by tests

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

Check warning on line 54 in src/pytest_celery/defaults.py

View check run for this annotation

Codecov / codecov/patch

src/pytest_celery/defaults.py#L54

Added line #L54 was not covered by tests

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

0 comments on commit 6815548

Please sign in to comment.