AttributeError on celery_session_app
See original GitHub issueI got the following error when launching error when lauching a celery task from pytest
Here is the code
@pytest.fixture(scope='session')
def celery_config():
return {
'broker_url': 'redis://redis:6379/0',
'result_backend': 'redis://redis:6379/0',
'task_always_eager': True,
'task_eager_propagates': True
}
@pytest.fixture(scope='session')
def celery_enable_logging():
return True
@pytest.mark.usefixtures("celery_session_worker")
class TestMyTask(object):
def test_task_failure(self, celery_session_worker):
"""
"""
result = mytask.delay('hello')
assert result.state == 'FAILURE'
The versions used
- pytest 4.1.1
- celery 4.2.0
I have tried downgrading to celery 4.0 and pytest 4.0, but I have the same issue This is a quite recent issue, I had run this code without trouble since last week about
Is there a bug behind this ?
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AttributeError: 'module' object has no attribute 'celery' - ...
I forgot to create a celery object in tasks.py: from celery import Celery from celery import task celery = Celery('tasks', ...
Read more >Python AttributeError — What is it and how do you fix it?
AttributeError : '***' object has no attribute '***'What is an AttributeError in Python? What can you do to fix it? When does it...
Read more >AttributeError: 'module' object has no attribute and ImportError
This video covers the AttributeError : 'module' object has no attribute and ImportError: No module name errors in Python.
Read more >[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >FIX Your AttributeError in Python & WHY You See it - YouTube
We all find ourselves spending hours trying to fix errors, and without a little help it can be very frustrating! the most common...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sounds good! since this is confirmed an external issue I’ll close this Thanks for the issue 🎉
Thanks Anthony
I confirm that downgrading to
pytest==3.10.1
fixed the issue, waiting for the release of celery 4.3 to fix the pytest 4 integration