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

GUI option to force running skipped pytest tests OR allow user selectable args at GUI run time? #24705

Open
red8888 opened this issue Jan 8, 2025 · 3 comments
Labels
area-testing community ask Feature request that the community expressed interest in feature-request Request for new features or functionality needs community feedback Awaiting community feedback

Comments

@red8888
Copy link

red8888 commented Jan 8, 2025

I want to be able to mark my tests with @pytest.mark.skip(reason="This test should not run in automation") and not run them automatically. This includes running locally by default and in the test explorer. So I can run all tests in the test explorer and it will skip these marked tests- this is how it works currently.

BUT I would also like a UI option that would allow me to right click on a test in test explorer or the editor and select "Force run test" or "Include skipped tests" or something like that.

There are a bunch of ways to fiddle with pytest to exclude/include tests when running via command line, but I want a purely UI feature for this and I want it selectable via the UI- ie not in some static config file I would have to continually modify before clicking a test in the GUI.

Could this be possible? Maybe if "Include skipped tests" is too specific a feature what about "Run test with pytest arg profile" and let users define selectable lists of args?

So in settings.json:

"python.testing.pytestOptionalGUIArgs": {
	my_arg_profile_one: ["--capture=no", "--my-custom-arg-to-included-skipped"],
	my_arg_profile_two: ["-vv", "--disable-warnings"],
	etc...
}

And in the test explorer I could right click a test, highlight "Run test with pytest arg profile" and get a drop down for "my_arg_profile_one" and "my_arg_profile_two". Doing this would obviously allow for a bunch of other use cases where you want to run tests with different settings seamlessly through the GUI.

This seems like it would be easy to roll, you would just grab a list of args from settings and append to the pytest command the GUI was already going to run.

@red8888 red8888 added the feature-request Request for new features or functionality label Jan 8, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 8, 2025
@eleanorjboyd
Copy link
Member

Thanks for the feature request! @connor4312 has anything been requested that is similar on the core side?

@eleanorjboyd eleanorjboyd added needs community feedback Awaiting community feedback community ask Feature request that the community expressed interest in labels Jan 9, 2025
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@eleanorjboyd eleanorjboyd removed info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team labels Jan 9, 2025
@connor4312
Copy link
Member

Not so far, but the multiple args profiles would map well onto the run profiles that we have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing community ask Feature request that the community expressed interest in feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Projects
None yet
Development

No branches or pull requests

4 participants