-
I'm struggling to figure out why I am getting this warning
Originally, I thought it was due to me using a session scoped
But now I'm not so sure, since I can also trigger the warning using the standard Contents of
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Sorry for the bad wording. Creating tasks should not cause any issues. Modification here essentially means replacing the current event loop within an async test or an async fixture. I had a brief look at the pytest plugins you're using and none of them seem to do anything like this. If you're willing to hack a bit, you can try replacing the DeprecationWarning with a ResourceWarning. Originally, the warning was intended as a ResourceWarning, because it allows users to track down the source of the unclosed event loop. ResourceWarnings are not shown by default, which is why it was changed to a DeprecationWarning (see commit 947e31a). If you modify the
to this:
and run your tests with From the top of my head, this is the best I've got, sorry :/ |
Beta Was this translation helpful? Give feedback.
Sorry for the bad wording. Creating tasks should not cause any issues. Modification here essentially means replacing the current event loop within an async test or an async fixture.
I had a brief look at the pytest plugins you're using and none of them seem to do anything like this.
If you're willing to hack a bit, you can try replacing the DeprecationWarning with a ResourceWarning. Originally, the warning was intended as a ResourceWarning, because it allows users to track down the sou…