You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support auto-refreshing Test Coverage from an external report #26266
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.
Activity