scripttest
Helper to test command-line scripts
Decision gist · record as of 2026-08-14
Yes. scripttest is actively maintained, has zero known vulnerabilities, carries a permissive MIT license, and installs with no dependencies. It is purpose-built for CLI testing and well-suited for any project that needs to verify command-line tool behavior in automated tests.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-07-08 with recent releases.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
last release 2026-07-08 (37 days) · last repo commit 2026-07-08 · 59 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 144,141 downloads/mo, #11,160 on PyPI
Alternatives
Verify before relying
pip install scripttest
from scripttest import TestFileEnvironment
env = TestFileEnvironment()
result = env.run('your-command')
assert result.stdout == 'expected output'- Whether scripttest integrates with unittest and doctest as suggested in the description excerpt.
What it is and what it does
scripttest is a testing library designed to help you verify the behavior of interactive command-line applications. It runs commands in subprocesses, captures their stdout and stderr output, and tracks any file modifications they produce. This makes it straightforward to write tests that validate what a CLI tool does without having to manually inspect output or filesystem state.
The library is built for developers testing their own command-line scripts and utilities. With no runtime dependencies and support for Python 3.8 through 3.13 on both CPython and PyPy, it's lightweight and compatible with modern Python environments.
Use it for
- Test a custom command-line tool by running it and verifying stdout and stderr output.
- Validate that a CLI utility creates, modifies, or deletes files as expected during execution.
- Write integration tests for build tools or deployment scripts that need to verify subprocess behavior.
- Verify error handling in CLI applications by capturing and asserting on stderr output.
- Test command-line scripts in automated test suites without manual output inspection.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
scripttest is actively maintained, has zero known vulnerabilities, carries a permissive MIT license, and installs with no dependencies. It is purpose-built for CLI testing and well-suited for any project that needs to verify command-line tool behavior in automated tests.
Install
scripttest on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-07-08 with recent releases.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects.
Quickstart
pip install scripttest
from scripttest import TestFileEnvironment
env = TestFileEnvironment()
result = env.run('your-command')
assert result.stdout == 'expected output'
Verify before relying
- Whether scripttest integrates with unittest and doctest as suggested in the description excerpt.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 144,141 / month, #11,160 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing |
Evidence: scripttest-3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “test command-line scripts”
- scripttestscripttest runs command-line applications in subprocesses and…
- pytest-console-scriptsA pytest plugin that runs Python console scripts within tests,…
- pytest-shutilProvides pytest fixtures and utilities for managing temporary…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also subprocess-tee · spur · runez · subprocess.run · subprocess-multitee · fancy-subprocess · EasyProcess · wurlitzer · python-editor · nose-py3