testpath
Test utilities for code working with files and commands
Decision gist · record as of 2026-08-14
Yes, if you're testing code that touches the filesystem or calls system commands. It's lightweight, permissively licensed, and has no dependencies. The aging maintenance status is a minor concern—the package is stable and unlikely to need frequent updates—but verify compatibility with your test framework before committing to it in a new project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is aging—last release was in 2022, though the repository remains active.
License · maintenance · safety
permissive license (permissive) — Licensed under BSD (permissive), so you can use it freely in commercial and open-source projects without significant restrictions.
last release 2022-02-23 (1633 days) · last repo commit 2025-11-25 · 31 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,766,957 downloads/mo, #3,577 on PyPI
Alternatives
Verify before relying
pip install testpath
import testpath
testpath.assert_isfile(path)
with testpath.assert_calls('git', ['add', path]):
function_under_test()- Whether the package is actively maintained or in maintenance-only mode given the gap between last release and current date.
- Compatibility with modern testing frameworks beyond the stated Python 3.5+ support.
What it is and what it does
Testpath is a small testing utility library that provides helpers for code that needs to verify filesystem state and mock system command execution. It offers functions like `assert_isfile()` to check file existence and a context manager to record and verify calls to external commands like `git`. The package has no runtime dependencies, making it lightweight to add to test suites.
It's designed for developers writing tests that interact with the filesystem or shell commands—situations where you want to verify that your code called the right external tools or created the expected files. The library sits in the Jupyter ecosystem and is used by projects that need reliable, simple assertions for file and command testing.
Use it for
- Verify that your code creates or modifies expected files during testing without leaving test artifacts.
- Mock and record calls to system commands like git, ensuring your code invokes them with correct arguments.
- Assert filesystem state in unit tests—check that a file exists or is a directory.
- Test code that shells out to external tools by capturing and validating command invocations.
- Build test suites for file-processing utilities that need to verify output files and side effects.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you're testing code that touches the filesystem or calls system commands.
It's lightweight, permissively licensed, and has no dependencies. The aging maintenance status is a minor concern—the package is stable and unlikely to need frequent updates—but verify compatibility with your test framework before committing to it in a new project.
Install
testpath on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was in 2022, though the repository remains active.
License in practice
Licensed under BSD (permissive), so you can use it freely in commercial and open-source projects without significant restrictions.
Quickstart
pip install testpath
import testpath
testpath.assert_isfile(path)
with testpath.assert_calls('git', ['add', path]):
function_under_test()
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the gap between last release and current date.
- Compatibility with modern testing frameworks beyond the stated Python 3.5+ support.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >= 3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 1,633 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,766,957 / month, #3,577 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Testing |
Evidence: testpath-0.6.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 file assertions”
- testpathTestpath provides utilities for testing code that interacts with…
- snapshottestSnapshot testing library that captures API responses or other…
- inline-snapshotinline-snapshot is a pytest plugin that lets you write snapshot tests…
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 testfixtures · pyfakefs · asserts · mock-open · pox · mock · TestSlide · mocksftp · flexmock · callee