Skip to content

Debug individual pytest and unittest tests directly from your code with simple buttons above each test method.

License

Notifications You must be signed in to change notification settings

dcaramello/python-debug-test

Repository files navigation

Buy Me a Coffee at ko-fi.com       LinkedIn Profile

Python Debug Test

A Visual Studio Code extension that simplifies debugging Python tests by adding convenient debug buttons directly in your code.

Features

🔍 One-Click Debugging

  • Debug pytest tests instantly
  • Debug unittest tests with a single click
  • Full debugging capabilities (breakpoints, variable inspection, step-by-step execution)
  • No configuration needed - works out of the box!

Getting Started

  1. Install the extension from VS Code Marketplace
  2. Open a Python test file
  3. Look for the debug buttons above your test methods:
    • "▶️ Run with pytest"
    • "▶️ Run with unittest"
  4. Click and start debugging!

Requirements

  • Visual Studio Code 1.97.0 or higher
  • Python extension for VS Code
  • Python 3.7 or higher
  • pytest and/or unittest installed in your environment

Installation

  1. Open Visual Studio Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Python Debug Test"
  4. Click Install
  5. Reload VS Code if prompted

Features in Detail

Automatic Test Discovery

  • Automatically detects test methods in your Python files
  • Supports both pytest and unittest style tests
  • Works with class-based and function-based tests

Smart Path Handling

  • Automatically determines the correct test path format
  • Handles both pytest and unittest path conventions
  • Supports Django test discovery

Debug Configuration

  • Automatically creates/updates launch.json
  • Configures the appropriate test framework
  • Sets up the correct working directory
  • Handles Django settings automatically

Visual Feedback

  • Clear indication of test locations
  • Easy-to-use debug buttons
  • Intuitive interface

Release Notes

0.0.1 (2024-02-17)

Initial release of Python Debug Test:

  • Support for pytest and unittest
  • Django integration
  • Automatic launch.json configuration
  • Debug buttons above test methods

0.0.2 (2025-04-23)

Improvements:

  • Added buttons to run all tests in a class
  • Enhanced visual appearance of unittest buttons with distinctive icons
  • Improved class-level test support

0.0.3 (2025-04-23)

Changes:

  • Updated extension icon

Support

Need help? Have a feature request? Found a bug?

Credits

Created by Dimitri Caramello

About

Debug individual pytest and unittest tests directly from your code with simple buttons above each test method.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published