Skip to content

Modifying result of --collect-only #11846

Answered by bluetech
Stefanhg asked this question in Q&A
Discussion options

You must be logged in to vote

When using --tags (your_tag) --collect-only it will still display all available tests and not just those within the tagged item.

Hmm, it should work. I just tested it with pytest's built-in -k and -m filters, which are both implemented with pytest_collection_modifyitems internally, and --collect-only only shows the filtered ones and the summary line reads 34/3551 tests collected (3517 deselected).

One thing that I'd try is change pytest-tagging pytest_collection_modifyitems implementation to not be a hookwrapper, I don't think there is any reason for it to be. I don't think it's related to what you're seeing but worth a try anyway.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Stefanhg
Comment options

Answer selected by Stefanhg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants