question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError on celery_session_app

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Jan 13, 2019

Sounds good! since this is confirmed an external issue I’ll close this Thanks for the issue 🎉

0reactions
gustellecommented, Jan 13, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found