pytest-dev / pytest-dev/pytest
logging: pytest should allow users to know why a test was deselected
@ssbarnea is already working on this.
Since Jul 24, 2025.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
Especially when using markers and complex testing scenarios, one would endup being surprised that some tests were deselected without a reason.
Very long time ago (3.x), pytest has some code that attempted to provide reason about this but this code was buggy and was removed.
While we might not want to pollute the default console logging, we would want to ensure that when running with -v (or more), decisions about marking tests as deselected are also logged, so users could figure out the likely wrong condition.
@The-Compiler I would like to work on this, but before starting to write any code, it would better to ensure that I am not trying to fix the wrong issue ;)
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.
Assessment
This issue has not been assessed yet.