Skip to content

Cannot restart test debugger (i.e. shift-cmd-F5) with "purpose"==["debug-test"] #17636

@tclose

Description

@tclose

Sorry, not sure whether this is a bug report or feature request

Environment data

  • debugpy version: 1.4.3
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.9.5 (default, May 4 2021, 03:33:11)
    [Clang 12.0.0 (clang-1200.0.32.29)] on darwin, built by Homebrew

Version: 1.60.2
Commit: 7f6ab5485bbc008386c4386d08766667e155244e
Date: 2021-09-22T11:59:27.195Z (1 wk ago)
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 19.6.0

Actual behavior

When debugging a pytest unit test in the test explorer with the following launch configuration

        {
            "name": "Test Config",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "justMyCode": true,
            "console": "integratedTerminal",
            "env": {
                "_PYTEST_RAISE": "1"
            },
        }

I am not able to restart the debugger using the debug controls (e.g. shift-cmd-F5) and receive the following message

This configuration can only be used as defined by `purpose`

Expected behavior

The debugging session is refreshed and the test run again

Steps to reproduce:

  1. Debug a unit test from test explorer
  2. Break at a breakpoint
  3. Click the "restart" button or press shift-cmd-F5

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bugverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions