Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow tests to run with "justMyCode": false without a launch configuration #21748

Closed
flying-sheep opened this issue Aug 3, 2023 · 5 comments
Closed
Labels
community ask Feature request that the community expressed interest in feature-request Request for new features or functionality

Comments

@flying-sheep
Copy link

flying-sheep commented Aug 3, 2023

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. @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.

@flying-sheep flying-sheep added the feature-request Request for new features or functionality label Aug 3, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 3, 2023
@karthiknadig karthiknadig added needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels Aug 3, 2023
@github-actions
Copy link

github-actions bot commented 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
Copy link
Member

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 brettcannon added needs proposal Need to make some design decisions community ask Feature request that the community expressed interest in labels Oct 5, 2023
@brettcannon
Copy link
Member

This just went out with the latest release of the debugger extension!

https://code.visualstudio.com/updates/v1_83#_python-debugger-updates

@github-actions github-actions bot removed needs community feedback Awaiting community feedback needs proposal Need to make some design decisions labels Oct 5, 2023
@flying-sheep
Copy link
Author

flying-sheep commented 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
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community ask Feature request that the community expressed interest in feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants