forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Closed as not planned
Copy link
Labels
area-testingfeature-requestRequest for new features or functionalityRequest for new features or functionality
Description
I would like to use additional pytest options when running tests, but not when discovering tests.
Scenario
- I want to generate coverage data on every test run, so I have this in my
settings.json:
"python.testing.pytestArgs": [
"src/unittests",
"--cov=.",
"--cov-report=xml:coverage.xml",
"-vvv"
],- But I don't want to generate coverage when debugging a test, so I disable it in my
launch.json:
{
"name": "Debug Tests",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"env": {"PYTEST_ADDOPTS": "--no-cov"},
"justMyCode": false
}- I also don't want coverage data when tests are discovered because discovery is way faster without these options. This seems to be impossible at the moment.
What I need
I think I need either a possibility to inject the --no-cov option somewhere around
| pytestargs.insert(0, "--collect-only") |
mikewl, copernico, Hibbie89, intptr-t, dtjohnson and 5 more
Metadata
Metadata
Assignees
Labels
area-testingfeature-requestRequest for new features or functionalityRequest for new features or functionality