Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for mocking in case of testing #7

Closed
ambivalentno opened this issue Jul 9, 2015 · 5 comments
Closed

Documentation for mocking in case of testing #7

ambivalentno opened this issue Jul 9, 2015 · 5 comments

Comments

@ambivalentno
Copy link

Greetings.
I've found this library quite interesting, but to start using it (as I follow TDD) it would be really convenient to know how to make asynchronous execution synchronous in case of testing (like CELERY_ALWAYS_EAGER). A friend of mine dropped rq as it was really hard to write tests for tasks code there.

@Koed00
Copy link
Owner

Koed00 commented Jul 9, 2015

It shouldn't be too hard to add something like that. I'll give it some thought and get back to you.

@ambivalentno
Copy link
Author

Great. If you also write how to use pdb inside of workers - it will be really good for us.
I mean, sometimes some issues occur in tasks which are really hard to detect without debugger (like, in celery tasks there's no django language context, so translations fail.

@Koed00 Koed00 closed this as completed in e62fd1e Jul 9, 2015
@Koed00 Koed00 reopened this Jul 9, 2015
@Koed00
Copy link
Owner

Koed00 commented Jul 9, 2015

It's been a long day and I committed this straight to master.
I added a sync=True option to the async command that injects a task straight into a worker and pipes the output through a monitor into the database.

@Koed00
Copy link
Owner

Koed00 commented Jul 9, 2015

As far as debugging; since everything runs inside a Django context, you can just debug like you would debug your own applications in Django.

@Koed00 Koed00 closed this as completed Jul 9, 2015
@ambivalentno
Copy link
Author

Great, Thank you!

msabatier pushed a commit to msabatier/django-q that referenced this issue Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants