Skip to content

Allow collecting coverage without pytest-cov #25724

@flying-sheep

Description

@flying-sheep

vscode-python assumes that pytest-cov is required to collect coverage. Many people just run coverage run pytest instead, which has several advantages.

So you should

  1. have the “run with coverage” button check if if pytest-cov is installed in the environment, and if not, run coverage.Coverage().start() before pytest.main() instead of adding --cov* args to pytest.main() (in run_pytest_script.py)
  2. in the plugin, you need to do a different check than checking for --cov-branch to set INCLUDE_BRANCHES

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionalitytriage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions