question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
karthiknadigcommented, Jan 24, 2022

Fixed via #18290

1reaction
int19hcommented, Oct 6, 2021

I think the scenario here is that the session is started via the Test Explorer, but then restarted (while it’s still running) via Run -> Restart Debugging.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot start debugger in Test Explorer - Visual Studio Feedback
Hi,. I am unable to start a debug session for a unit test written with Xunit. When I use CTR-R CTR-T or start...
Read more >
Error: Unable to Start Debugging on the Web Server
Multiple debugger instances may be attached to the IIS process; a reset terminates them. For more information, see Check your IIS Configuration.
Read more >
Debugger not working in IE 11 F12 developer tools
Then restart IE and enjoy your DEV TOOLS! ... Uncheck "Disable script debugging (Internet Explorer)" ... Check "Enable protected mode".
Read more >
Debug JavaScript in Internet Explorer 11 in 7 easy steps
You can now start to step through the code. To do this, you use the four buttons in the debugging pane. play pause...
Read more >
Internet Explorer debug tutorial | DebugBar
It also allows you to run arbitrary Javascript code with its input, which can be useful for security tests and other debugging forms....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found