skilkis / vscode_python_pytest_multi_root_breakpoint_issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiroot Workspace Pytest Coverage Debugging Issue

Not being able to use breakpoints when coverage is running is a known issue. It is possible to disable coverage during test debugging in VS Code by specifying a customized launch configuration that sets PYTEST_ADDOPTS to --no-cov. However, this customized configuration only reads launch.json. This repository demonstrates this "bug", which is actually documented in the VS Code docs.

Project A demonstrates that pytest configured with the --no-cov option in pyproject.toml can stop at breakpoints as expected. However, even though the correct configuration settings are set in workspace.code-workspace Project B shows that the same breakpoint that works in Project A does not stop execution during test debugging. This indicates that indeed VS Code Python only examines the launch.json file for a customized test debug launch configuration.

In the future, it would be beneficial if VS Code Python can parse customized test debugging configurations from settings.json as well as from multi root workspaces.

About


Languages

Language:Python 100.0%