Curtaincall
Testing library for terminal applications.
Curtaincall is a pytest plugin for testing terminal (TUI) applications. It spawns real PTY sessions, emulates a VT100 terminal, and provides an expressive assertion API with auto-waiting locators. Inspired by Microsoft's tui-test.
The docs/ folder ships with the package — this README mirrors its structure. Each section here is a short summary that links to a full page in docs/. Published version: thekevinscott.github.io/curtaincall.
Installation
pip install curtaincall
Curtaincall registers itself as a pytest plugin automatically. The terminal fixture is available in any test file without imports.
Requirements: Python 3.10+, Linux or macOS (Unix PTYs).
Motivation
TUI applications are typically tested by mocking stdin/stdout, which doesn't catch real terminal behavior: cursor positioning, color codes, redraws, signal handling, scrollback. Curtaincall runs your CLI in a real PTY and emulates a VT100 terminal, so tests assert against what a user would actually see.
Quick Start
from curtaincall import expect
def test_git_help(terminal):
term = terminal("git --help")
expect(term.get_by_text("usage: git")).to_be_visible()
def test_interactive_cli(terminal):
term = terminal("python my_cli.py")
term.submit("hello")
expect(term.get_by_text("Hello!")).to_be_visible()
Guide
Getting Started
Install, write your first test, and learn how PTY spawning + VT100 emulation drive auto-waiting assertions. → docs/guide/getting-started.md
Terminal
The Terminal class manages a child process running in a pseudo-terminal. Read the screen, inspect the cursor, resize, and clean up. → docs/guide/terminal.md
Locators
get_by_text() returns a lazy locator that finds text on the screen by substring, full-line, or regex match. → docs/guide/locators.md
Assertions
expect(locator).to_be_visible() polls until the condition holds. Also covers color and text-content assertions, with screen content in failure messages. → docs/guide/assertions.md
Snapshots
term.to_snapshot() serializes the screen as a box-drawn string, suitable for snapshot testing with syrupy. → docs/guide/snapshots.md
Input
Send text, arrow keys, special keys, control sequences (Ctrl+C, Ctrl+D, etc.), and mouse clicks to the terminal. → docs/guide/input.md
Fixtures
The terminal fixture is a factory: terminal(command, rows=30, cols=80, env=None). Multiple terminals per test are supported; cleanup is automatic. → docs/guide/fixtures.md
API Reference
Generated reference for the public API. → docs/api/
Terminal— docs/api/terminal.mdLocator— docs/api/locator.mdexpect— docs/api/expect.md- Types — docs/api/types.md
Migrations
Upgrade instructions for releases with breaking changes or meaningful deprecations. → MIGRATIONS.md
License
MIT
Metadata
Release files for curtaincall 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| curtaincall-0.4.0.tar.gz | 33.9 kB | With provenance | Details for curtaincall-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curtaincall-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for curtaincall-0.4.0-py3-none-any.whl |
Total release size: 63.0 kB
Release files / curtaincall-0.4.0.tar.gz
| Download URL | curtaincall-0.4.0.tar.gz |
|---|---|
| Size | 33.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b68c9652cb33eb0955e5b9307573302e8b6f260930a67ab69152c48db79b75cc
|
|
BLAKE2b-256 checksum How to use checksums |
4cc314a2abeb4d38d1c381c33fb3fbd4d55675a0f98be8c39b15d688c546b3f3
|
| 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 Oct 26, 2026.
Transparency logRelease files / curtaincall-0.4.0-py3-none-any.whl
| Download URL | curtaincall-0.4.0-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2294a8b8e2d8cd10f47f5004ae7bc9b68ce9f7f1182c364dba294b3d190aa726
|
|
BLAKE2b-256 checksum How to use checksums |
bc436c5749737b1fbb9a2757adf6df70ded2a38e832b63d4b4f9e75b6adf1080
|
| 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 Oct 26, 2026.
Transparency logSecurity for curtaincall 0.4.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.
Attestation for curtaincall-0.4.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 Oct 26, 2026.
Transparency logA 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.