Skip to content

Allow collecting coverage without pytest-cov #25724

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions