pytest-dev / pytest-dev/pytest
`pytest -k` should ignore private attributes (starting with `_`)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
I originally opened this issue in hypothesis, but they told me to open it here https://github.com/HypothesisWorks/hypothesis/issues/2508.
When I run pytest -k name, and name only matches hypothesis tests, pytest runs all hypothesis tests, not just the ones that match. When name matches a non-hypothesis test, it only picks the tests that contain name as expected.
I am using pytest 5.4.3 and hypothesis 5.21.0. It happens even when I set aside my pytest.ini and conftest.py.
You can reproduce this at the repo https://github.com/Quansight/ndindex/ by running pytest -v -k repr.
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
Reproduce the behavior in the Quansight/ndindex repository with pytest -v -k repr, using the reported pytest 5.4.3 and Hypothesis 5.21.0 versions if possible. Start from pytest's -k selection behavior and compare matches from Hypothesis tests with non-Hypothesis tests. Done means private attributes no longer cause unrelated Hypothesis tests to run, while ordinary name matching still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100