pytest-dev / pytest-dev/pytest
session.testscollected misnomer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
pytest version: 7.0.0
In hookspec.py
5. Set ``session.testscollected`` to the number of collected items
But this variable actually contains the number of SELECTED tests.
The value is set at after pytest_collection_modifyitems, where items might be deselected.
To avoid breaking existing code I would suggest just deprecating this variable and adding:
- tests_selected
- tests_collected
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hookspec.py and trace where session.testscollected is assigned after pytest_collection_modifyitems, including the effect of deselected items. Review the existing session attribute API and compatibility requirements. Done means the selected and collected counts have clear, distinct names without breaking existing users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100