Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: restore pre-pytest 7.1.0 confcutdir exclusion behavior #9780

Merged
merged 1 commit into from Mar 17, 2022

Conversation

bluetech
Copy link
Member

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 #9767.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@henryiii
Copy link

henryiii commented Mar 17, 2022

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 pytest

works like it did before 7.1. (Ironically, pytest 6.1.0 broke boost-histogram too, so my exclusion list seems to be *.1.0 :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version 7.1.0 seems like not picking up conftest.py
3 participants