--- id: testpath version: "0.6.0" license: unclear license_treatment: permissive maintenance: aging --- # testpath — Test utilities for code working with files and commands License: permissive · Maintenance: aging · Downloads: 1.8M/mo ## 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 above — verify before relying. Testpath provides utilities for testing code that interacts with files and system commands, including filesystem assertions and mocking of command-line calls. 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 pip install testpath uv add testpath poetry add testpath ## Installing testpath 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 1.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags test file assertions, mock system commands, filesystem testing utilities, command call recording, test utilities for files, testing file operations, assert file exists, filesystem-testing, command-mocking [View on SkillFed](https://skillfed.io/packages/testpath) · [View on PyPI](https://pypi.org/project/testpath/)