pytest-shutil
A goodie-bag of unix shell and environment tools for py.test
Decision gist · record as of 2026-08-14
Yes, with conditions. The package is stable and permissively licensed, with low install friction and no known vulnerabilities. However, maintenance is aging—the last release was 623 days ago—so adopt it only if you need its specific pytest fixtures for shell and environment testing and can accept slower response to future pytest or Python version changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure-Python wheel distribution.
- Maintenance status is aging—last release was 623 days ago, though the repository remains active with recent commits and no archived status.
License · maintenance · safety
MIT license (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2024-11-29 (623 days) · last repo commit 2026-01-28 · 598 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 220,856 downloads/mo, #9,291 on PyPI
Alternatives
Verify before relying
pip install pytest-shutil
# In conftest.py or test file:
pytest_plugins = ['pytest_shutil']
def test_example(workspace):
path = workspace.workspace
script = path / 'test.sh'
script.write_text('#!/bin/sh\necho hello')
workspace.run('test.sh')- Whether the workspace fixture's path object behavior remains stable after migration from path.py to pathlib in version 1.8.0
- Current compatibility with pytest versions beyond 4.0.0 and Python 3.13
What it is and what it does
pytest-shutil is a collection of pytest fixtures and helper functions designed to simplify testing of shell scripts, command-line tools, and code that interacts with the filesystem or environment. It centers on a workspace fixture—a function-scoped temporary directory with convenience methods for running commands and managing files—plus utilities for controlling environment variables, changing directories, managing umasks, and executing subprocesses with output capture and coverage integration.
The package wraps common Unix testing patterns into reusable pytest fixtures and context managers, reducing boilerplate in test suites that need to spawn processes, manipulate the environment, or work with temporary file hierarchies. It depends on pytest, six, execnet, termcolor, and importlib-metadata, and targets Python 3.6 and later.
Use it for
- Test shell scripts or command-line tools by running them in isolated workspaces and capturing their output.
- Verify code behavior under different environment variable configurations using set_env and unset_env context managers.
- Run Python functions or modules as if they were entry points, useful for testing CLI entry points or subprocess isolation.
- Manage temporary directories with automatic cleanup in test fixtures, avoiding manual tempfile boilerplate.
- Execute subprocesses with coverage instrumentation to measure test coverage of spawned processes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
The package is stable and permissively licensed, with low install friction and no known vulnerabilities. However, maintenance is aging—the last release was 623 days ago—so adopt it only if you need its specific pytest fixtures for shell and environment testing and can accept slower response to future pytest or Python version changes.
Install
pytest-shutil on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 623 days ago, though the repository remains active with recent commits and no archived status.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install pytest-shutil
# In conftest.py or test file:
pytest_plugins = ['pytest_shutil']
def test_example(workspace):
path = workspace.workspace
script = path / 'test.sh'
script.write_text('#!/bin/sh\necho hello')
workspace.run('test.sh')
Verify before relying
- Whether the workspace fixture's path object behavior remains stable after migration from path.py to pathlib in version 1.8.0
- Current compatibility with pytest versions beyond 4.0.0 and Python 3.13
Package facts
| License | MIT license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagessixexecnetpytesttermcolorimportlib-metadata |
| Maintenance | Aging 623 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 220,856 / month, #9,291 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 :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities |
Evidence: pytest_shutil-1.8.1-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 › “temporary workspace management”
- pytest-shutilProvides pytest fixtures and utilities for managing temporary…
- databricksapiA Python wrapper for the Databricks REST API that provides…
- azure-mgmt-batchaiManages Azure Batch AI resources (clusters, jobs, experiments,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
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.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
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.
See also pytest-fixture-config · pytest-rabbitmq · pytest-redis · pytest-postgresql · pytest-docker · pytest-unused-fixtures · pytest-datadir · tempenv · pytest-mock-resources · pytest-profiling