{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"A pytest plugin that runs Python console scripts within tests, supporting both in-process execution (fast iteration) and subprocess mode (realistic testing).","skillfed_tags":["cli-testing","script-runner","pytest-plugin"],"use_cases":["Test CLI tools and console scripts installed via setup.py entry_points during development.","Validate that scripts behave identically when run in-process (fast) and subprocess (realistic) modes.","Capture and assert on stdout, stderr, and return codes from Python scripts in test suites.","Mock functions inside console scripts during in-process test runs to isolate behavior.","Speed up test iteration by running scripts in-process, then verify with subprocess mode in CI."],"what_it_does":"pytest-console-scripts is a pytest plugin that lets you test Python console scripts as if they were being run from the command line. It provides a `script_runner` fixture that captures output and return codes, and offers two execution modes: in-process (where the script runs in the same Python interpreter as pytest, speeding up test suites) and subprocess (where the script runs in a fresh interpreter, simulating real-world invocation more closely).\n\nYou can run scripts installed via console_scripts entry points, standalone Python files, or executables on the PATH. The plugin supports configuring execution mode globally via pytest config, per-test via command-line flags, or per-test via pytest markers. In-process mode enables mocking of script internals, while subprocess mode validates that scripts work correctly when invoked independently.","worth_installing":"Yes, if you maintain Python CLI tools or console scripts and want to test them within pytest. The dual execution mode (in-process for speed, subprocess for realism) is a genuine advantage over subprocess.run() alone. However, note that the package is aging\u2014last release was May 2023 with no recent commits\u2014so verify compatibility with your pytest version before adopting. No known security vulnerabilities."},"id":"pytest-console-scripts","links":{"html":"https://skillfed.io/packages/pytest-console-scripts","md":"https://skillfed.io/packages/pytest-console-scripts.md","pypi":"https://pypi.org/project/pytest-console-scripts/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2023-05-31","license_spdx":null,"license_treatment":"permissive","name":"pytest-console-scripts","python_support":"supports_current","summary":"Pytest plugin for testing console scripts"},"popularity":{"monthly_downloads":241463,"position":8876,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.4.1"}
