You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow tests to run with "justMyCode": false without a launch configuration #21748
As requested in #19030 (comment), I’m creating a new feature request.
"justMyCode": false is a VS Code for Python debugger setting that has to be placed in a launch configuration (see below). It allows people to set breakpoints and step into 3rd party code. I found it plain necessary to debug how any non-trivial code interacts with library code. Brett Cannon (@brettcannon) mentioned in that thread that the default "justMyCode": true is a deliberate choice based on user feedback. However that doesn’t work for library and plugin developers, who often have to step into other libraries’ code.
Running tests using the test runner uses a built-in/implied launch configuration. In order to set that setting, you need to find the linked-to docs and create an entry in .vscode/launch.json. The docs for this are good but encountered quite far into a long document and hard to find using a web search. Instead, web searches tend to dredge up long-obsolete launch configurations.
I therefore propose to either switch "justMyCode" to false by default, as it supports more use cases, or to add a python.debug.justMyCode setting that allows easier and more discoverable configuration of this setting than creating a magic run configuration.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
When I click “Debug Unit test”, my breakpoint isn’t hit. I suspect the Python extension uses its own debugger instead of the one provided by the “Python Debugger” extension.
When I click “Debug Unit test”, my breakpoint isn’t hit. I suspect the Python extension uses its own debugger instead of the one provided by the “Python Debugger” extension.
Please open an issue against the debugger extension; it should work fine.
Activity
github-actions commentedon Aug 3, 2023
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
brettcannon commentedon Oct 5, 2023
Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.
We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.
brettcannon commentedon Oct 5, 2023
This just went out with the latest release of the debugger extension!
https://code.visualstudio.com/updates/v1_83#_python-debugger-updates
flying-sheep commentedon Oct 6, 2023
And how do I use that extension with unit tests?
When I click “Debug Unit test”, my breakpoint isn’t hit. I suspect the Python extension uses its own debugger instead of the one provided by the “Python Debugger” extension.
brettcannon commentedon Oct 17, 2023
Please open an issue against the debugger extension; it should work fine.