How to disable "just my code" setting in VSCode debugger?

For this you need to change the launch.json file. Inside the launch.json file you have to set "justMyCode" to false.

As described here. (I was pointed to that link through this post on the Visual Studio Code site.)


Just adding "justMyCode": false to launch.json doesn't work. You need to add a separate config in launch.json like below. FYI each {} represents a config.

"configurations": [
        {
           .... # existing config
        },
        {
            "name": "Debug Unit Test",
            "type": "python",
            "request": "test",
            "justMyCode": false,
        }
    ]

As pointed out in here


VSCode 1.60 was complaining about the "request": "test" method suggested by others.

But I did have to add a new section below my existing configuration to get "justMyCode": false to work.

Here is what worked for me:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        

        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "blah",
                "whatever"
            ]
        },
        {
            "name": "Python: Debug Unit Tests",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false,
        }
    ]
}

The purpose addition appears to be important.

I found the correct approach documented here: https://code.visualstudio.com/docs/python/testing#_debug-tests