#๐Ÿ”’ Python debugging with VS Code?

4 messages ยท Page 1 of 1 (latest)

vale fiber
#

Hi friends, can anyone please help me setup VS Code for debugging python. Particularly tests?

I'm able to run the tests from "Testing" side bar as VS code discovered them. I'm trying to debug python tests. I'm able to set a breakpoint and the control stop at the breakpoint when running the test from the "Testing" section. However, when I try to step into a method which is being called from the test case, VS code just skips that line and moves on to the next one without stepping into the method call. It also sends me a notification which i shared below.

The method I'm trying to setup into is part of my repo/workspace code. Not a library

launch config

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug my API",
            "type": "debugpy",
            "request": "launch",
            "module": "uvicorn",
            "args": [
                "ABC.DEF.main:app",
                "--reload"
            ],
            "envFile": "${workspaceFolder}/src/.env",
            "cwd": "${workspaceFolder}/src",
            // "justMyCode": false,
            "jinja": true
        }
    ]
}
stiff spadeBOT
#

@vale fiber

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

stiff spadeBOT
#

@vale fiber

Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.