Skip to main content
PyPI version Python versions See Build Status on Travis CI

A pytest plugin to easily enable debugging tests within Visual Studio Code.

Features

Enables debugging a test session within Visual Studio Code, via attaching the debugger.

Installation

You can install “pytest-vscodedebug” via pip from PyPI:

$ pip install pytest-vscodedebug

You will need to configure the debugging in Visual Studio Code, via editing .vscode/launch.json:

{
  "configurations": [
    {
      "name": "Python: Remote Attach",
      "type": "python",
      "request": "attach",
      "connect": {
        "host": "localhost",
        "port": 10001,
      },
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}",
          "remoteRoot": "."
        }
      ]
    }
  ]
}

Usage

You can enable pytest-vscodedebug when running tests with the --vscodedebug flag:

$ py.test --vscodedebug test_testfile.py

By default, it will listen on port 10001, but you can change it via the --vscodedebug-port option:

$ py.test --vscodedebug --vscodedebug-port=5001 test_testfile.py

License

Distributed under the terms of the MIT license, “pytest-vscodedebug” is free and open source software.

This code is largely based on adriencaccia’s tutorial “Flask Debugging in VS Code with Hot-Reload 🔥”.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Release files for pytest-vscodedebug 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-vscodedebug 0.1.0
File Size Uploaded
pytest-vscodedebug-0.1.0.tar.gz 6.2 kB Details

Release files / pytest-vscodedebug-0.1.0.tar.gz

Download URL pytest-vscodedebug-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d2ca5a9edc6699c6e8afee7af064eabd359c92a3fb98691227d535f95d944a68
BLAKE2b-256 checksum
How to use checksums
737df043babf67d266288de6e921a1f51f8e9cdcb2bac910f3eaed37c5ff4651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page