Open stdedos opened 5 months ago
For completeness:
This is also a nice reproducer. I have been having a similar issue in a proprietary code that threw more or less the same
cannot-enumerate-pytest-fixtures
error.I have been trying to troubleshoot it with https://github.com/pylint-dev/pylint-pytest/tree/playground/impr/cannot-enumerate-pytest-fixtures. In any case - I don't get how is it possible that the current environment "disappears" and neither
requests
northis.namespace.package.sub.module
"exist" anymore.Funny thing is that, pytest alone is able to figure the issue out (no variant of
pytest --fixtures --collect-only ...
reveals any issue, nor does it fail pytest).To be honest, I have been blocking v2 behind tl;dr this issue and pytest v8 😶🌫️ (my time being limited, and no progress in figuring out the logic behind this :confused:)
ANY help is more than welcome :pray: (from people that know how module discovery works? pytest internals?)
I'm eager to reproduce this if I can. I cloned scriv and ran
python -m tox -e quality
and it passed, without any output suggesting the scriv command ran.I ran without tox as
pylint src/scriv tests docs setup.py
after installingpylint_pytest
, and with pytest 7.4.2, and the files linted, although they threw lots of errors like:Once I can reproduce, I'm happy to bisect the pylint or astroid changes that could be to blame. I wonder if knowing your installed version of pytest would help. Any other tips for reproducing would be appreciated. Thanks.
Originally posted by @jacobtylerwalls in https://github.com/pylint-dev/pylint-pytest/issues/67#issuecomment-2125770504