Skip to main content

A TUI (terminal user interface) for pytest, because testing should be fun.

Project description

pytuist

A TUI (terminal user interface) for pytest

I personally love TUI tools - so why not learn how to make my own and create something that would be valuable for my day-to-day work?

Installation

pip install pytuist

Note this package is only available for Windows at the moment. I will look to add support for Linux and MacOS in the future.

If someone could show me how on earth I specify that with Poetry, that would be great.

Usage

Within a project with tests conforming to pytest requirements, run pytuist to start the UI within the active terminal:

╭─────────────────────────────────────────────────────────────────────────────────────────── pytuist ───────────────────────────────────────────────────────────────────────────────────────────╮
│ arrows: navigate | enter: expand/collapse | space: run | q: quit                                                                                                                              │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭──────────────────── Tests ────────────────────╮ ╭────────────────────────────────────────────────────────────────── Output ───────────────────────────────────────────────────────────────────╮
│ test                                      [-] │ │ Run a test to see the output here                                                                                                           │
│ ├── test_root                             [-] │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
│ │   └── test_in_root                      [-] │
│ ├── test_root_again                       [-] │
│ │   └── test_another_in_root              [-] │
│ ├── child                                 [-] │
│ │   ├── test_child                        [-] │
│ │   │   ├── test_child                    [-] │
│ │   │   └── test_another_in_child         [-] │
│ │   └── grandchild                        [-] │
│ │       ├── test_another_grandchild       [-] │
│ │       │   ├── test_another_grandchild   [-] │
│ │       │   └── test_that_fails           [-] │
│ │       └── test_grandchild               [-] │
│ │           └── test_grandchild           [-] │
│ └── unit                                  [-] │
│     └── actual_test                       [-] │
│         ├── test_construct_test_hierarchy [-] │
│         └── test_render                   [-] │
╰───────────────────────────────────────────────╯

Navigate using arrow keys, press enter to expand/collapse folders, and space to run a test. Output generated by pytest will be shown in the output panel.

Future Work

Current functionality is known to be minimal (and Windows-only), and I hope to continue expanding upon it and making the user experience as easy as possible.

I'm sure there are plenty of configurations where the intended highlighting and functionality doesn't work, so feel free to let me know what horrible bugs you encounter if you'd like to.

This was largely a project to help me become familiar with rich and create TUI apps, so we'll see where it goes from here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytuist-0.0.1.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

pytuist-0.0.1-py3-none-any.whl (19.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page