Keath Milligan

On software development, quality, security and broken racecars

Tag: debugging

Debugging pytest in VSCode (without adding files to your project)

For debugging pytest executions, the official VSCode Python extension documentation recommends creating an additional file in your project, e.g.:

and setting up a launcher to start the debugger against it. While this is simple, I really don’t like having to modify my project’s code or add source files just to satisfy my editor/IDE.

So, to debug pytest without having to create an additional source file, setup a launcher configuration with the “program” option pointing to the “pytest” script itself, for instance:

In my case, I have a virtual environment setup in the root of the project (.virtualenv).… Read More...

Debugging a Flask 0.11 app in Visual Studio Code

Visual Studio Code with the the Python extension makes for a great Python development environment – especially if you work on blended Python/Javascript web apps. The Python extension includes a built-in template launch definition for debugging a Flask app, but it assumes you have an old-style “run.py” script in your project. If you are using Flask 0.11.x, chances are you use the new “flask” command to launch your app.

First, be sure you have your virtual environment configured in VSCode (you are using a virtual environment, right?).… Read More...

© 2017 Keath Milligan

Theme by Anders NorenUp ↑