Repository navigation
feat(testing): expose pytest marks as tags in Test Explorer - #26259
Open
Srikanth Palutla (sripal2013) wants to merge 1 commit into
Open
Srikanth Palutla (sripal2013) wants to merge 1 commit into
Srikanth Palutla (sripal2013) wants to merge 1 commit into
Conversation
Extract pytest marks during test discovery and expose them as VS Code TestTags (mark.<name>), so tests can be filtered by mark in the Test Explorer (e.g. @python-tests:mark.slow). Marks are deduplicated preserving discovery order, and the parametrize marker is excluded. Items from adapters that do not report marks keep only the default run/debug tags. Fixes microsoft#20350
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20350
This exposes pytest marks as VS Code TestTags so tests can be filtered
by mark in the Test Explorer (e.g. @python-tests:mark.slow).
Changes
extracted from test_case.own_markers, deduplicated in discovery
order. The parametrize marker is excluded since it describes
parameterization, not a user mark.
populateTestTree maps them to mark. tags alongside the
existing run/debug tags. Adapters that don't report marks are
unaffected.
parametrized, and unmarked cases), a discovery test asserting the
tags payload, and two new populateTestTree unit tests.