[py] Fix pytest_ignore_collect hook to respect --ignore#15787
[py] Fix pytest_ignore_collect hook to respect --ignore#15787cgoldberg merged 1 commit intoSeleniumHQ:trunkfrom
Conversation
Fix the `pytest_ignore_collect` hook to respect `--ignore` specified by the user. Returning `False` stops pytest from consulting additional hooks, including its default hooks that are necessary to process `--ignore` option. By returning `True` or `None`, the hook combines files ignored by default with ignores specified by the user.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
For example, if you run: Without the patch, |
|
The failure in CI is unrelated to this change. |
cgoldberg
left a comment
There was a problem hiding this comment.
got it. thanks for the contribution!
|
Thanks! |
User description
🔗 Related Issues
💥 What does this PR do?
Fix the
pytest_ignore_collecthook to respect--ignorespecified by the user.🔧 Implementation Notes
Returning
Falsestops pytest from consulting additional hooks, including its default hooks that are necessary to process--ignoreoption. By returningTrueorNone, the hook combines files ignored by default with ignores specified by the user.💡 Additional Considerations
This is a pure test change.
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Fixes
pytest_ignore_collectto respect--ignoreoptionEnsures default pytest ignores are combined with custom ignores
Prevents premature stopping of hook processing
Changes walkthrough 📝
conftest.py
Fix test collection ignore logic for pytestpy/conftest.py
pytest_ignore_collectto returnTrueorNoneinstead ofFalse--ignoreoption