-
Notifications
You must be signed in to change notification settings - Fork 68
pytest django SynchronousOnlyOperation #29
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
Comments
@PyB1l, for running Django tests with playwright you need to set environment variable # conftest.py
import os
os.environ.setdefault("DJANGO_ALLOW_ASYNC_UNSAFE","true") |
Closed because of inactivity. Feel free to reopen if the solution by @kumaraditya303 does not work. |
I have same problem, i use pytest-asyncio and channels with Django, how i can make this works without set environment variable? |
I am trying the simplest scenario without pytest-playwright plugin.
And I am getting the following error
django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
The text was updated successfully, but these errors were encountered: