Read test debug configuration from settings not just launch.json
See original GitHub issueIssue Type: Bug
Behaviour
Expected vs. Actual
Adding this to my .vscode/launch.json
allows me to use breakpoints in third-party libraries when debbuging unit tests:
{
"name": "Debug Unit Test",
"type": "python",
"request": "test",
"justMyCode": false
}
I expect that adding the same to the launch
section of my workspace settings would produce the same behaviour but this is not true.
Steps to reproduce:
- Add the above debug config to your
.vscode/launch.json
file. - Add a breakpoint to a third party tool.
- Debug a unit test that calls the third party code and the debbuger will stop in the breakpoint.
- Delete the
.vscode/launch.json
file. - Add the above debug config in your workspace settings.
- Add a breakpoint to a third party tool.
- Debug a unit test that calls the third party code and the debbuger will skip the breakpoint.
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.10.0
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
- Value of the
python.languageServer
setting: Default
User Settings
defaultLS: {"defaultLSType":"Pylance"}
downloadLanguageServer: true
envFile: "<placeholder>"
venvPath: "<placeholder>"
venvFolders: "<placeholder>"
condaPath: "<placeholder>"
pipenvPath: "<placeholder>"
poetryPath: "<placeholder>"
languageServer: "Pylance"
linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: true
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"
sortImports
• args: "<placeholder>"
• path: "<placeholder>"
formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"
testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true
terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"
experiments
• enabled: true
• optInto: []
• optOutFrom: []
insidersChannel: "off"
tensorBoard
• logDirectory: "<placeholder>"
Extension version: 2022.2.1924087327 VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T15:36:26.048Z) OS version: Linux x64 4.14.240 Restricted Mode: No
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Debugging in Visual Studio Code
To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and...
Read more >The launch.json file for the DevTools extension - Microsoft Learn
In the Run and Debug Side Bar, click Start Debugging. The two DevTools tabs open, and Visual Studio Code enters Debug mode. This...
Read more >How to disable "just my code" setting in VSCode debugger?
Just adding "justMyCode": false to launch.json doesn't work. You need to add a separate config in launch.json like below.
Read more >Debugging
To get started debugging, run the command Debug: Open launch.json . If you did not already have a launch.json file for your project,...
Read more >Troubleshooting - Jest
When Jest executes the test that contains the debugger statement, ... Then attach VS Code's debugger using the following launch.json config:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It doesn’t help that the command
Open 'launch.json'
in the command palette just opens settings.json if you haven’t got a launch.json. That makes you think there would be no difference between where you add a configurationHi @ElPincheTopo, the launch.json configuration has changed for debugging tests (see https://code.visualstudio.com/docs/python/testing#_debug-tests). Can you try the configuration below?
And just out of pure curiosity, what is the reason behind using it on your workspace configuration rather than launch.json?