Issue 1:
Checklist

I have checked the issues list

for similar or identical enhancement to an existing feature.

I have checked the pull requests list

for existing proposed enhancements.

I have checked the commit log

to find out if the if the same enhancement was already implemented in the

master branch.

I have included all related issues and possible duplicate issues in this issue

(If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Brief Summary

Design

Architectural Considerations

None

Proposed Behavior

Proposed UI/UX

Diagrams

N/A

Alternatives

None

Issue 2:
Checklist

I have included the output of celery -A proj report in the issue.

software -> celery:4.2.0 (windowlicker) kombu:4.2.1 py:2.7.15
billiard:3.5.0.3 py-amqp:2.3.2
platform -> system:Linux arch:64bit imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:redis://redis:6379/0

task_create_missing_queues: True
task_routes: {
'my_package.tasks.*': { 'queue': 'my_queue'}}
broker_url: u'amqp://guest:********@queue:5672//'
result_backend: u'redis://redis:6379/0'
task_track_started: True

I have verified that the issue exists against the master branch of Celery.

Steps to reproduce

create a pytest test case that uses the celery_worker fixture:

@pytest.fixture()
def celery_worker_parameters():
return {
'queues': ('my_queue',),
'exclude_queues': ('celery'),
}

def test_my_task(celery_worker):
pass

Expected behavior

Task should have the celery_worker fixture present and run.

Actual behavior

The test immediately fails with the following error and renders the terminal unresponsive.

request = <SubRequest 'celery_worker' for <Function 'test_my_task'>>, celery_app = <Celery celery.tests at 0x7ff488539e50>, celery_includes = (), celery_worker_pool = 'solo', celery_worker_parameters = {'exclude_queues': 'celery', 'queues': ('my_queue',)}

@pytest.fixture()
def celery_worker(request,
celery_app,
celery_includes,
celery_worker_pool,
celery_worker_parameters):
# type: (Any, Celery, Sequence[str], str) -> WorkController
"""Fixture: Start worker in a thread, stop it when the test returns."""
if not NO_WORKER:
for module in celery_includes:
celery_app.loader.import_task_module(module)
with worker.start_worker(celery_app,
pool=celery_worker_pool,
> **celery_worker_parameters) as w:

/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/contrib/pytest.py:176:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python2.7/contextlib.py:17: in __enter__
return self.gen.next()
/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/contrib/testing/worker.py:82: in start_worker
assert ping.delay().get(timeout=ping_task_timeout) == 'pong'
/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/result.py:224: in get
on_message=on_message,
/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/backends/async.py:190: in wait_for_pending
return result.maybe_throw(callback=callback, propagate=propagate)
/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/result.py:329: in maybe_throw
self.throw(value, self._to_remote_traceback(tb))
/root/.local/share/virtualenvs/py-ITn23Csk/lib/python2.7/site-packages/celery/result.py:322: in throw
self.on_ready.throw(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <promise@0x7ff487200b98 --> <bound method AsyncResult._on_fulfilled of <AsyncResult: b6db7179-f73e-431c-941b-0d63acc190e3>>>, exc = Task of kind u'celery.ping' never registered, please make sure it's imported., tb = None, propagate = True

def throw(self, exc=None, tb=None, propagate=True):
if not self.cancelled:
current_exc = sys.exc_info()[1]
exc = exc if exc is not None else current_exc
try:
self.throw1(exc)
svpending = self._svpending
if svpending is not None:
try:
svpending.throw1(exc)
finally:
self._svpending = None
else:
lvpending = self._lvpending
try:
while lvpending:
lvpending.popleft().throw1(exc)
finally:
self._lvpending = None
finally:
if self.on_error is None and propagate:
if tb is None and (exc is None or exc is current_exc):
raise
> reraise(type(exc), exc, tb)
E NotRegistered: u'celery.ping'