Skip to main content

pytest-tui-run

PyPI - Python Version PyPI - Version pipeline status

TUI for running pytest.

pytest-tui-run in action

Motivation

Do you like running pytest from the terminal, but find it difficult to run a subset of tests? Do you like VS Code's test tree view, but hate using the mouse? Then pytest-tui-run is for you: it combines the best of both worlds by showing you the collected test tree, but allows you to use your keyboard to select and run tests. Even better, it comes with vim-like keybindings by default, which are fully configurable.

Alternatives

There are similar projects, but none with the same scope.

  • pytest-explorer. TUI for running pytest tests. Fast, but no tree view and no test selection (apart from filtering).
  • pytest-tui-runner. TUI for running pytest tests that have been selected in a configuration file. Mouse centric and no view of all tests.
  • pytest-tui. Pytest plugin TUI for exploring pytest results. No test running.
  • VS Code Testing View. GUI for running tests in a tree view. Plugins for multiple languages and test frameworks. Mouse centric and works only in VS Code.
  • Neotest plugin for Neovim. TUI for running tests in a tree view. Plugins for multiple languages and test frameworks. Works only in Neovim.

Philosophy

Don't reinvent the wheel: everything that can be delegated to pytest, is delegated to pytest. This is to keep the plugin as lightweight as possible to minimize the burden of maintaining. In practice this means that the plugin mostly just modifies the user-given pytest arguments, and then runs pytest with those arguments.

Installation

The package is distributed through PyPI, so simply use your favorite package manager. For example using pip:

pip install pytest-tui-run

Usage

This is a pytest plugin, so you can start it from the terminal by

pytest --tui-run

Just give it the arguments you would normally give to plain pytest. Another option is to start the app directly:

pytest-tui-run

There are two ways to run the (selected) tests:

Run tests in TUI

Press r to run the (selected) tests directly in the TUI. This shows you the output and marks the test results in the tree.

Run tests in CLI

Press R to run the (selected) tests in CLI. This exits the TUI and prints you the proper pytest command to run.

Configuration

The default configuration includes all the available configuration options. A schema is included for validation. Both of these are included with the package to ensure compatible versions. To get started, run

pytest --tui-run --init-config

This will copy the default config to your config directory (usually ~/.config/pytest-tui-run/, unless you have some custom XDG_CONFIG_HOME set) and create a symlink to the schema.

You may use your favorite validation tool, but a schema directive for Taplo (in VS Code the Even Better TOML plugin) is included in the config file by default. In other words, if you have a Taplo-compatible editor, you should get schema validation out of the box, assuming you have properly symlinked the schema file.

Contributing

Contributions are welcome. See CONTRIBUTING.md for details.

Metadata

Release files for pytest-tui-run 0.2.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-tui-run 0.2.0
File Size Uploaded Provenance
pytest_tui_run-0.2.0.tar.gz 27.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-tui-run 0.2.0
File Interpreter ABI Platform
pytest_tui_run-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.2 kB

Release files / pytest_tui_run-0.2.0.tar.gz

Download URL pytest_tui_run-0.2.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
50d2da763514ecb5a7516363c7538509f7123ac87fbf8ec15b50f91c52ba9eb1
BLAKE2b-256 checksum
How to use checksums
b38be6bcdc96791290a83222a6db64601d9a270bc6819e5546168066b083e437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pytest_tui_run-0.2.0-py3-none-any.whl

Download URL pytest_tui_run-0.2.0-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40f4bddddacd02984e64f141dfdc7d6f615b668296d99669131fd31cdde7a9c0
BLAKE2b-256 checksum
How to use checksums
60ed50c5f438dca976617cb55a292c442daebf2927cfb0f9ac41498b4fcfff17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pytest-tui-run 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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