Skip to main content
Stack Overflow is like an encyclopedia, so we prefer to omit these types of phrases. It is assumed that everyone here is trying to be helpful.
Source Link
Dharman
  • 33.1k
  • 27
  • 99
  • 146

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

Hope this helps!

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

Hope this helps!

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

Source Link
warrens
  • 2.1k
  • 21
  • 16

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

Hope this helps!