{"library":"scripttest","title":"scripttest","description":"A library for testing command-line scripts (CLI applications) in Python. It provides a TestEnvironment that captures stdout, stderr, and simulates stdin. Current version 2.0.post1. Release cadence is low; no new releases for several years.","language":"python","status":"maintenance","last_verified":"Fri May 01","install":{"commands":["pip install scripttest"],"cli":null},"imports":["from scripttest import TestEnvironment"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport sys\nfrom scripttest import TestEnvironment\n\ndef test_hello_world():\n    env = TestEnvironment()\n    # Run a simple echo command\n    result = env.run('echo', 'Hello World')\n    assert result.stdout == 'Hello World\\n'\n    assert result.returncode == 0\n    print(\"Test passed!\")\n\nif __name__ == '__main__':\n    test_hello_world()","lang":"python","description":"Basic usage: create a TestEnvironment, then run a command using env.run(). Check stdout, stderr, and returncode.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}