Skip to content

Support auto-refreshing Test Coverage from an external report #26266

Open

Description

Problem

The Python extension renders coverage only for test runs started by the Test Explorer.

Coverage reports generated by external commands cannot refresh the Test Coverage view or editor decorations, even when a valid local coverage.xml already exists.

Why this matters

AI coding agents are increasingly integrated with local test execution.
They can run tests and generate coverage reports through existing project commands,
but their textual output alone is not an ideal verification surface.

Automatically rendering a locally generated coverage report in VS Code provides a visible,
independently inspectable signal:
developers can immediately review which files and lines were covered without rerunning the tests through the UI.
This makes the Test Coverage view a practical verification layer for automated test runs,
including those initiated by AI agents.

Requested feature

Add an opt-in setting that watches a local coverage report and automatically refreshes coverage when the report changes.

{
    "python.testing.coverageReport": {
        "path": "${workspaceFolder}/coverage.xml",
        "format": "cobertura",
        "autoRefresh": true
    }
}

Expected behavior
- Watch the configured local report when autoRefresh is enabled.
- Parse it after a successful file update.
- Update the existing Test Coverage view and inline coverage decorations.
- Map report paths to workspace files.
- Do not rerun pytest.
- Show clear errors for missing or invalid reports.
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

    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