Open tamird opened 5 months ago
Hey thanks for bringing this to my attention! I'm wondering if you have a plugin or something in your config that's not compatible? I'm not familiar with that library. Supposedly importing pytest first should fix this, but I would think that's how its being ran?
Does it work if you do poetry run python -m pytest <my-test-case>
?
The behavior is sadly the same with python -m pytest
. How can I go debugging?
I see a couple things:
anyio
specifically, I don't see the harm in this warning.anyio
, so the question I would have is whether it's even necessaryaddopts = "-n 1 -p pytest_hot_reloading.plugin -p megamock.plugins.pytest"
You can also try disabling the anyio plugin. I'm guessing it's -p no:anyio
but I'm not sure
I see a couple things:
- This is a warning so it shouldn't cause anything to fail unless you've enabled warnings as errors. You can squelch this warning to make it go away (ask ChatGPT how). If you're not testing
anyio
specifically, I don't see the harm in this warning.
You're right, we have all warnings turned up to errors. Suppressing this one unblocks me.
- I haven't used
anyio
, so the question I would have is whether it's even necessary
We aren't using it directly. anyio
isn't a plugin, it's a "plain old library": https://github.com/agronholm/anyio. We aren't using it directly, it's a transitive dependency that doesn't appear by name in our code. It's a dependency of httpx
.
- Are you able to confirm that this plugin is indeed causing the issue? Does changing the plugin order (the order they are defined can matter) resolve the issue? We have the hot reloading plugin FIRST
addopts = "-n 1 -p pytest_hot_reloading.plugin -p megamock.plugins.pytest"
You can also try disabling the anyio plugin. I'm guessing it's
-p no:anyio
but I'm not sure
I'm not sure how to use this advice (particularly the bit about loading order) given anyio isn't a plugin.
By the way, after suppressing the warning I get a new failure mode when I run the tests for the second time. EDIT: gist
Based on the docs it appears to have a plugin that I'm guessing is executed automatically
Have you tried setting pytest to the version that matches what this library is using? 7.2.2
I haven't - I'm on pytest 8.2.2. What would it take to make this compatible with pytest 8?
Very cool project. Sadly it seems not to work with my project and doesn't emit much information.