Skip to content

Read launch config from devcontainer file #354

Closed
microsoft/vscode-python
#23817
@rubensa

Description

@rubensa

Related to this and this.

Looks like there is a missing piece on getting launch configurations when debugging python tests through the GUI.

I'm using VSCode devcontainers and have a launch configuration in .devcontainer/devcontainer.json file, like:

{
  "customizations": {
    "vscode": {
      "settings": {
        "launch": {
          "configurations": [
            {
              "name": "Python Debugger: Current File",
              "type": "debugpy",
              "request": "launch",
              "program": "${file}",
              "purpose": [
                "debug-test"
              ],
              "justMyCode": false,
              "console": "integratedTerminal",
              "env": {
                "ENVIRONMENT": "test"
              },
              "envFile": "${workspaceFolder}/.devcontainer/.env.local"
            }
          ]
        }
      }
    }
  }
}

The launch configuration is applied when using Run and Debug but not on Testing.

As a workaround, I can "duplicate" the configuration in .vscode/launch.json file and then it is picked up both in Run and Debug and Testing.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions