Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Filter tests by pytest marker #286

Open
LiamDeaconAntarcticaAM opened this issue Aug 12, 2022 · 0 comments
Open

Feature request: Filter tests by pytest marker #286

LiamDeaconAntarcticaAM opened this issue Aug 12, 2022 · 0 comments

Comments

@LiamDeaconAntarcticaAM
Copy link

I love this extension, but it would be truly awesome to be able to filter (and then run) tests within the Test Explorer side pane based on the pytest marker that tests have been annotated with 🚀

image

Quick idea would be to extend the @tag functionality with something like @pytest:<marker> .

A list of known (i.e. registered) markers could be scanned for within the config files that pytest itself lists. Alternatively the information can be gathered from pytest itself via pytest --markers, e.g.

$ pytest --markers | grep -E '^@pytest.mark.' | grep -Ev '^@pytest.mark.[a-z]+\('
@pytest.mark.unittest: mark as an isolated unit test
@pytest.mark.integration: mark as an integration test
@pytest.mark.django: mark as requiring django
@pytest.mark.slow: mark as a slow-running test
@pytest.mark.no_cover: disable coverage for this test.
@pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible.
@pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible.

What would need to be done to make this happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant