Skip to content

TPI: Debugging Python, Test automatic configuration #36

Closed
@paulacamargo25

Description

@paulacamargo25

Refs: microsoft/vscode-python#19503

Complexity: 3

Author: @paulacamargo25


Prerequisites:

  • Install python, version >= 3.7
  • Install the debugpy extension.
    Automatically detect a Flask application and run it with the correct Debug Configuration.

Steps

Part 1: Debugging python file

  1. Create a python file with a simple code.
  2. Head over to the Run And Debug tab, and click on Show all automatic debug configurations.

Screen Shot 2022-07-25 at 2 09 44 PM

3. A window will open with a list of options, choose `Debugpy`. 4. You should now see a list of debug options, and there should be the Python File option.

Verification

  1. Make sure that the application has been executed correctly, you can put some breakpoints, to test that the debugging works.
  2. . If you repeat the steps and instead of clicking the option, you click the wheel, it should open the launch.json file with the configuration prefilled. Make sure this is correct and can be debugged.
  3. Another form to show the automatic configuration is typing 'debug ' (with a space) in Quick open (⌘P) or by triggering the Debug: Select and Start Debugging command. Test that the recognition works here too.

Part 2: Try other automatic configuration

  1. There are automatic configurations implemented for Django, FastApi and Flask, if you have any of these projects you can try that they also work with them. Because this functionality has already been tested in the Python extension, you don't need to test each one. The idea of this tpi is to make sure that it also works in the debugpy extension. Trying one of them is enough.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions