Skip to content

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

Closed

Description

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.

Activity

  1. github-actions commented on Aug 3, 2023

    @github-actions

    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.

  2. brettcannon commented on Oct 5, 2023

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

  3. brettcannon commented on Oct 5, 2023

    @brettcannon
    Member

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

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

  4. flying-sheep commented on Oct 6, 2023

    @flying-sheep
    Author

    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.

  5. brettcannon commented on Oct 17, 2023

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

  6. locked as resolved and limited conversation to collaborators on Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    community askFeature request that the community expressed interest infeature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions