Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions tests/integrations/celery/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ def inner(propagate_traces=True, backend="always_eager", **kwargs):
request.addfinalizer(lambda: Hub.main.bind_client(None))

# Once we drop celery 3 we can use the celery_worker fixture
w = worker.worker(app=celery)
t = threading.Thread(target=w.run)
t.daemon = True
t.start()
if VERSION < (5,):
worker_fn = worker.worker(app=celery).run
else:
from celery.bin.base import CLIContext

worker_fn = lambda: worker.worker(
obj=CLIContext(app=celery, no_color=True, workdir=".", quiet=False),
args=[],
)

worker_thread = threading.Thread(target=worker_fn)
worker_thread.daemon = True
worker_thread.start()
else:
raise ValueError(backend)

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ envlist =
{py3.6,py3.7}-sanic-19

# TODO: Add py3.9
{pypy,py2.7}-celery-3
{pypy,py2.7,py3.5,py3.6}-celery-{4.1,4.2}
{pypy,py2.7,py3.5,py3.6,py3.7,py3.8}-celery-{4.3,4.4}
{pypy,py2.7}-celery-3
{py3.6,py3.7,py3.8}-celery-5.0

{py2.7,py3.7}-beam-{2.12,2.13}

Expand Down Expand Up @@ -138,6 +139,7 @@ deps =
celery-4.3: vine<5.0.0
# https://github.com/celery/celery/issues/6153
celery-4.4: Celery>=4.4,<4.5,!=4.4.4
celery-5.0: Celery>=5.0,<5.1

requests: requests>=2.0

Expand Down