--- id: scripttest version: "3.0" license: MIT license_treatment: permissive maintenance: active --- # scripttest — Helper to test command-line scripts License: permissive · Maintenance: active · Downloads: 144.1K/mo ## 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 above — verify before relying. scripttest runs command-line applications in subprocesses and captures their output and file modifications for testing purposes. 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 pip install scripttest uv add scripttest poetry add scripttest ## Installing scripttest 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_current - Install friction: low - Maintenance: active - Downloads: 144.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags test command-line scripts, subprocess output testing, interactive CLI testing, command execution testing, shell script testing, stdout stderr capture, CLI application testing, cli-testing, subprocess-automation [View on SkillFed](https://skillfed.io/packages/scripttest) · [View on PyPI](https://pypi.org/project/scripttest/)