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

Plans for async support? #441

Open
pgcd opened this issue May 24, 2022 · 4 comments
Open

Plans for async support? #441

pgcd opened this issue May 24, 2022 · 4 comments

Comments

@pgcd
Copy link

pgcd commented May 24, 2022

Are there plans to add async support (at least to views and middleware)? Alternatively, is there any demand for it?

@clintonb
Copy link
Collaborator

This is the first request. Pull requests are welcome.

@schinckel
Copy link

Okay, I have a work in progress: however it will likely change the existing decorators to use contextlib.ContextDecorator (and contextlib.AsyncContextDecorator). Is that going to be acceptable?

@schinckel
Copy link

Actually, looking at the code, it seems it already uses a subclass of that (via django.test.utils.TestContextDecorator).

I think I'll need to do more digging to find out how to make it work.

@schinckel
Copy link

Turned out the simplest thing to do was to wrap the test (inside the application of the waffle decorator), like show at the bottom of the section https://docs.djangoproject.com/en/5.0/topics/testing/tools/#testing-asynchronous-code

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

3 participants