-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add separate python.testing.pytestArgs
settings for regular, debug and discovery runs
#21255
Comments
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. |
Also related to #18778. Here is that whole comment from there: I would like to use additional pytest options when running tests, but not when discovering tests. Scenario
"python.testing.pytestArgs": [
"src/unittests",
"--cov=.",
"--cov-report=xml:coverage.xml",
"-vvv"
],
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"env": {"PYTEST_ADDOPTS": "--no-cov"},
"justMyCode": false
}
What I needI think I need either a possibility to inject the
|
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future. We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most. |
I created a proposal with a solution for this problem, would love your input on the above issue! #21845 |
closing as the proposal will guide the solution creation to your PR |
Evolved from #21190.
Related to #693, #19809, #19985 and some others.
Some of the pytest plugins may change how it works (e.g. running in parallel via
pytest-xdist
) or do some actions that are required on regular test runs but are unwanted on debug or discovery runs (e.g. generating a coverage report viapytest-cov
). Currently vscode provides a single setting for configuring the args, and they are used for all the kinds of runs. Sometimes such behavior is inconvenient. Separating the single setting into 3 (for regular runs, for debug runs and for discovery runs) would make configuring pytest much more flexible.Something like
or
The text was updated successfully, but these errors were encountered: