Skip to main content

pytest-deck

CI Docs PyPI

An interactive browser dashboard for pytest. Collect your suite as a foldable tree, pick what to run with checkboxes or marker chips, and watch results stream in test by test, with tracebacks and captured output one click away.

Its defining promise: a deck run matches a real command-line pytest run. Every collect, reload, and run is a fresh python -m pytest subprocess, never in-process. What you see in the browser is what your terminal would say, and a crashing or hanging test can't take the dashboard down with it.

The dashboard running the examples suite: statuses stream into the test tree, rollup counts fill in on each file, and a failed test is pinned with its traceback in pytest's own colors

Beta. Collect, select, run with live streaming, reload with diff, plugin switches, coverage down to a source gutter, benchmark timings, and per-test attachments all work. See the changelog and the docs for the full picture.

Install

pip install pytest-deck

Quick start

pytest-deck is a pytest plugin. Launch the dashboard with --deck:

pytest --deck                           # dashboard for the current project (rootdir)
pytest --deck path/to/tests             # dashboard for a specific path
pytest --deck pkg_a/tests pkg_b/tests   # several paths, files, or node IDs, as for pytest

Nothing runs in the terminal. The deck prints its URL (http://127.0.0.1:8765/ by default); open it in your browser and your suite is there as a foldable tree.

Without --deck the plugin is inert: your normal pytest runs are completely unaffected.

To see everything at once, point the deck at this repo's examples/ suite. Install the plugins you want to try and run pytest --deck examples/.

For the full tour, start with the quickstart.

Features

The live basics

  • A foldable file → class → test → parametrized-variant tree with rollup counts on every group.
  • Select with checkboxes, marker chips that bulk-select every matching test, and -k / -m expression fields.
  • Hit ▶ Run and PASS / FAIL / ERROR / SKIP stream in live as each test finishes, tracebacks in pytest's own colors, captured output alongside. The run summary's FAILED lines carry the same clickable badge, and every traceback has a copy button.
  • Re-run failed: one click re-runs everything currently failed or errored, regardless of the selection.
  • ↻ Collect to re-collect after an edit: added, removed, and changed tests are flagged, and selection plus results are preserved for tests that still exist.

Plugins

Installed plugins appear as switches in the sidebar, each with a typed config form, so you never have to hunt through a plugin's flags. Switches ship ready-made for:

  • pytest-cov
  • pytest-benchmark
  • pytest-mpl
  • pytest-metadata
  • pytest-mock
  • pytest-asyncio
  • pytest-django

For any other plugin, a one-file TOML description (a manifest) in .pytest-deck/plugins/ adds a switch of your own.

Your ini addopts aren't lost either. Each token either prefills a switch's config form, follows its plugin's switch automatically, or shows up as a clickable suggestion chip. Nothing is dropped silently.

Coverage: a source file open in the detail pane with a line-by-line hit and miss gutter

Benchmarks: the tree's mean-time column in ns, µs and ms, with one test pinned to show its stats table

→ Plugins guide · Writing your own manifest

Standalone server

The dashboard also runs without the pytest CLI:

pytest-deck path/to/tests            # console script
python -m pytest_deck.server path/to/tests

One difference from pytest --deck path/to/tests: the standalone command roots the project at the path you give, with no walk up to find the root.

Options: --host (default 127.0.0.1), --port (must be free; default: first free port from 8765, up to 8785, announcing any fallback), and --open (open a browser tab on launch; off by default). Through pytest, --deck-port is the same as --port.

How it works

Every collect and run is a fresh pytest subprocess. A small plugin injected into those subprocesses emits structured JSON on a dedicated file descriptor, a private channel that keeps machine-readable results separate from pytest's captured output. A FastAPI backend streams those events to the browser over Server-Sent Events. The deep dive lives in the docs: How It Works.

Documentation

Full documentation is at pytest-deck.readthedocs.io:

Limitations

  • pytest-xdist is not supported. The deck reads each run's results over a dedicated pipe, and xdist's worker subprocesses don't inherit that pipe, so results would never reach the dashboard. The deck therefore forces -p no:xdist for its own runs: if xdist is installed in your project it stays disabled here, and runs are serial.
  • Localhost only. The server binds to 127.0.0.1 with no auth, and it executes your test code. Don't expose it on an untrusted network.

Development

Requires Python 3.11+ and Node 24 LTS (for the frontend build).

# backend
pip install -e ".[test]"
pytest                       # the full suite

# frontend (Svelte 5 + Vite); builds into pytest_deck/static/
cd frontend
npm install
npm run build

Run the full matrix (Python 3.11 to 3.14 × pytest 8/9, plus the frontend build) with tox. The development guide has the details.

pytest-deck is written with AI assistance. The design decisions, the reviews, and the bugs are mine. AI-assisted contributions are welcome here, held to the same bar.

License

MIT

Metadata

Release files for pytest-deck 0.3.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-deck 0.3.0
File Size Uploaded Provenance Actions
pytest_deck-0.3.0.tar.gz 499.5 kB With provenance Details for pytest_deck-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-deck 0.3.0
File Interpreter ABI Platform Actions
pytest_deck-0.3.0-py3-none-any.whl Python 3 none any Details for pytest_deck-0.3.0-py3-none-any.whl

Total release size: 619.2 kB

Release files / pytest_deck-0.3.0.tar.gz

Download URL pytest_deck-0.3.0.tar.gz
Size 499.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7791e8a0f99f3fc2560079f4238d8b9e6ea97958ce250565e8e23079a645cd4c
BLAKE2b-256 checksum
How to use checksums
f755f4b2c5946978dc1ed9e637db510b5f9b9076882fb14f0531c56e566fc611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / pytest_deck-0.3.0-py3-none-any.whl

Download URL pytest_deck-0.3.0-py3-none-any.whl
Size 119.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6a1363cbc373400b5c0fb02de2b10f15eff28d5b7fe901b71d4c006142f7b5f
BLAKE2b-256 checksum
How to use checksums
c8199ad7d2bb62a21d851ea58af3a1200dc184e8824f5fc85950ed680c90e695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for pytest-deck 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytest_deck-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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