You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the connection is close by some one, probably client, before the function is over.
the test case can pass if I use the @pytest.mark.django_db(transaction=True) marker. But I don't know the reason.
The text was updated successfully, but these errors were encountered:
I was having a similar issue, but with (I assume) a significant difference of not using @async_unsafe.
In my case, I was using a fixture to create a requests client - https://www.django-rest-framework.org/api-guide/testing/#requestsclient. After some experiments, I figured out that using this client instead of the usual django client resulted in connection already closed errors - perhaps the testing django client is more closely tied to the test flow?
environment:
the error log
the test case
It seems like the connection is close by some one, probably
client
, before the function is over.the test case can pass if I use the
@pytest.mark.django_db(transaction=True)
marker. But I don't know the reason.The text was updated successfully, but these errors were encountered: