config: restore pre-pytest 7.1.0 confcutdir exclusion behavior#9780
config: restore pre-pytest 7.1.0 confcutdir exclusion behavior#9780bluetech merged 1 commit intopytest-dev:mainfrom
Conversation
The change from `path not in confuctdir.parents` to the `relative_to` check in 0c98f19 broke picking up conftest files when running against an installed package/site-packages. See the issue for more details. Fix pytest-dev#9767.
| except ValueError: | ||
| return False | ||
| return True | ||
| return path not in self._confcutdir.parents |
There was a problem hiding this comment.
i recall parents being painfully expensive,
presuming the given paths are absolute, would it make sense to ensure that the path parts match (aka the common path between path and confcutdir being the path)
this is a idea for a follow-up unless its a easy check
There was a problem hiding this comment.
Yes, it's super slow. I was going to say that this just brings things to the way they were, but previously at least the parents call was hoisted out of the loop, so it'd be worse now. That said, I'll work on it for the next release, to unblock the fix.
|
I can verify that this fixes the issue seen in scikit-hep/boost-histogram#720, which has a "test from cmake build dir" that broke with 7.1: cmake -S. -Bbuild
pip install 'git+https://github.com/bluetech/pytest@restore-confcutdir-behavior'
cd build
python -m pytestworks like it did before 7.1. (Ironically, pytest 6.1.0 broke boost-histogram too, so my exclusion list seems to be *.1.0 :) ) |
The change from
path not in confuctdir.parentsto therelative_tocheck in 0c98f19 broke picking up conftest files when running against an installed package/site-packages. See the issue for more details.Fix #9767.