pytest-pythonpath
pytest plugin for adding to the PYTHONPATH from command line or configs.
What it is and what it does
pytest-pythonpath is a pytest plugin that modifies the Python import path before tests run by reading path directives from pytest.ini. It allows you to specify directories to prepend to sys.path or process as site directories, enabling tests to import modules from custom locations without modifying PYTHONPATH manually.
However, this plugin is now obsolete. As of pytest 7.0.0, the same functionality is available natively via the `pythonpath` configuration option in pytest.ini, making this plugin unnecessary for any pytest version released since early 2022. The package is abandoned and receives no maintenance.
Use it for:
- Legacy projects still running pytest <7.0.0 that need to configure import paths via pytest.ini.
- Codebases with custom module layouts where sys.path manipulation is simpler than restructuring imports.
- Projects that cannot upgrade pytest and need a drop-in path configuration mechanism.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds directories to Python's import path before pytest runs, configured via pytest.ini—but this functionality is now built into pytest 7.0.0 and later.
No. If you are using pytest 7.0.0 or later (released January 2022), use pytest's native `pythonpath` config option instead. If you are stuck on an older pytest version, consider upgrading rather than adopting an abandoned plugin. There are no known security vulnerabilities, but the package receives no maintenance and its purpose is now redundant.
Install
pytest-pythonpath on PyPI
pip
pip install pytest-pythonpathuv
uv add pytest-pythonpathpoetry
poetry add pytest-pythonpathInstalling pytest-pythonpath
Before you install
Low install friction, but the package is abandoned as of March 2022 (1646 days without updates). Its core feature was integrated into pytest 7.0.0, making it obsolete for modern pytest versions.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—standard permissive terms.
Quickstart
# Add to pytest.ini:
[pytest]
python_paths = your/path/apps your/path/libs
# Then run pytest normally:
pytest
Only works with pytest versions before 7.0.0; pytest 7.0.0+ has native pythonpath configuration built in.
Verify before relying
- Whether the plugin still functions correctly with pytest 7.0.0+ despite being marked obsolete.
- Compatibility with Python versions beyond 3.10 (classifiers list 3.10 as highest, but requires_python allows <4).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.6, <4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | abandoned — 1,646 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 265,618/month — #8,321 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_pythonpath-0.7.4-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-dotenvA pytest plugin that automatically loads…
permissive · top 5,000 on PyPI
pyrootutilsFinds your project root directory and…
permissive · top 5,000 on PyPI
rootutilsFinds your project root directory and…
permissive · top 15,000 on PyPI
pytest-isortA pytest plugin that automatically checks…
permissive · top 15,000 on PyPI
pytest-datafilesA pytest plugin that copies specified files and…
permissive · top 15,000 on PyPI
pytest-envA pytest plugin that loads environment…
permissive · top 1,000 on PyPI
pytest-mypy-pluginsA pytest plugin that runs type-checking tests…
permissive · top 15,000 on PyPI
pytest-redisA pytest plugin that provides fixtures for…
copyleft · top 15,000 on PyPI
pytest-runnerEnables running pytest tests through setup.py…
permissive · top 1,000 on PyPI