-
In a Django project, I use pytest-playwright for acceptance tests using Daphne and Django Channels. This works great, but when a test runs that tests an async view (using This is how I set Daphne up for testing: https://github.com/openradx/adit-radis-shared/blob/c0615600a8bab511aa0ce22baa3e6ba11be0ad8d/adit_radis_shared/common/utils/testing_helpers.py#L21 Do you have any suggestions on what might be going wrong or how I can investigate this problem further?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @medihack — We see a few of these issues for folks using pytest, but no-one has dug in to see what's actually happening (or what the correct workaround would be). It seems to be something to do with the way pytest manages event loops and such on a per-test basis. I'm afraid I can't say more as I'm not a big pytest user. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, @carltongibson. Maybe I will switch back to |
Beta Was this translation helpful? Give feedback.
Thanks for the reply, @carltongibson. Maybe I will switch back to
unittest
. I am not much of a fan of those pytest fixtures anyway (no IDE autocomplete support in VSC, and they are very obscure sometimes). I'll close the discussion for now and will report back if the problem remains withunittest
.