skillfed

pytest-pythonpath

pytest plugin for adding to the PYTHONPATH from command line or configs.

pytest-pythonpath v0.7.4 265.6K downloads/30d#8,321 on PyPI80
Permissive license MIT Abandoned released

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-pythonpath

uv

uv add pytest-pythonpath

poetry

poetry add pytest-pythonpath

Installing 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

Development Status :: 5 - Production/StableEnvironment :: PluginsFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.0Programming Language :: Python :: 3.1Programming Language :: Python :: 3.10Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Tags

pytest pythonpath configurationadd paths to sys.path pytestpytest import path setuppytest.ini python pathspytest module search pathpytest custom import directories
pytest-pluginobsolete

More Testing packages