Debugging Python Tests in VSCode
VSCode offers native test capabilities that are quite useful. Testing Python in Visual Studio Code
It doesn’t, however, recognize your Python tests by default. You must configure it to do so for each project.
Command Palette (CTRL+SHIFT+P) → “Python: Configure Tests” →
Select the framework you’re using:
Now, you get all of the testy-goodness that VSCode has to offer for Python.
In this case, I wanted to debug a specific test. Super easy! Just drop breakpoints in the test where you want them, then run “Debug Test”.
The “Test Explorer” is also quite useful.