Repository navigation
Description
vscode-python/src/client/debugger/extension/configuration/debugConfigurationService.ts
Line 71 in bee8d3b
| 'This configuration can only be used by the test debugging commands. `"request": "test"` is deprecated use "purpose" instead.', |
The official documentation for debugging Python tests (https://code.visualstudio.com/docs/python/testing#_debug-tests) states: "To customize settings for debugging tests, you can specify "request":"test" in the launch.json file." However, when I configure my launch.json file like that, and then try to run w/ debug (F5), I get an error message: "This configuration can only be used by the test debugging commands. '"request": "test"' is deprecated use "purpose" instead."
I don't mind changing my launch.json file. However, in order to comply with the error message and "use 'purpose' instead," I need to know the precise syntax to use. The phrase "use purpose" doesn't tell me if that should be the key or the value in the json - should it be "purpose": "test" or should it be "request": "purpose"? Actually, neither one of these work. Both throw an error. Either "Attribute 'request' has an unsupported value 'purpose' in the chosen debug configuration", or "This configuration can only be used as defined by purpose."
As a user who is trying to just be able to debug tests in Python, I am left scratching my head.
If it is helpful, here is my launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Run Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
},
{
"name": "Python: Debug Tests (Integrated Terminal)",
"type": "python",
"request": "test",
//"request": "purpose",
//"purpose": "test",
"console": "integratedTerminal",
"justMyCode": false,
"stopOnEntry": false
}
]
}
Activity
karthiknadig commentedon Aug 30, 2021
Jeff Wright (@jeffwright13) Which version of the extension are you using? If it is insiders version (2021.9.*-dev) then this should work:
If you are using insiders you should see this:

jeffwright13 commentedon Aug 30, 2021
Karthik Nadig (@karthiknadig) - I am running version v2021.9.1176299738-dev. I have since turned off all insiders options, but it appears as if the dev version has persisted (I did not specifically downgrade). However, I am now unable to get the original error message to appear.
Is this new syntax (
"purpose": ["debug-test"]) documented somewhere? That was the big issue for me...the error message told me I had something misconfigured but did not let me know what the valid options are, or point me to some documentation where the new options are listed.jaron-l commentedon Aug 30, 2021
It looks like it's documented in their pull request for the 2021.9 release. I'm just commenting because I came here for the same reason and found the above link in my research. Doesn't seem like it works in the most recent non-dev release (at least in 2021.8.1159...) as tested on my computer.
Edit: In the last sentence, I meant to say that the new method doesn't work and I confirmed it's not supposed to. The old, documented method does work on my computer.
karthiknadig commentedon Aug 30, 2021
Jeff Wright (@jeffwright13) We will update the documentation when we release 2021.09. We are planning on releasing it on Sep 1st 2021, see here for release date and details: #16930