--- id: pytest-dotenv version: "0.5.2" license: unclear license_treatment: permissive maintenance: abandoned --- # pytest-dotenv — A py.test plugin that parses environment files before running tests License: permissive · Maintenance: abandoned · Downloads: 5.5M/mo ## What it is and what it does pytest-dotenv is a pytest plugin that integrates python-dotenv to automatically load environment variables from .env files before tests run. It detects .env files in the working directory or ancestor directories and populates os.environ without overriding existing system variables by default. The plugin supports multiple configuration files (e.g., .env, .test.env, .deploy.env) defined in pytest config files like pytest.ini or tox.ini, and can be controlled via command-line flags. The package depends on pytest and python-dotenv as its only runtime dependencies, making installation lightweight. However, it is archived and abandoned—the last release was in June 2020, and there have been no updates since. While it remains popular (top 5000 packages), the lack of maintenance means it may not be compatible with recent pytest or Python versions, and security or compatibility issues will not be addressed. Use it for: - Load test-specific environment variables from .env files without modifying system environment during CI/CD pipelines - Manage multiple environment configurations (.env, .test.env, .deploy.env) for different test scenarios - Automatically populate pytest fixtures or test code with environment-based configuration without manual setup - Override environment variables selectively during test runs while preserving production settings in the base environment ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that automatically loads environment variables from .env files before test runs, with support for multiple files and optional override of existing system variables. No—not for new projects. The package is archived and abandoned since 2020, with no maintenance or security updates. While it may still work with older pytest and Python versions, there is significant risk of incompatibility with modern tooling. Consider using python-dotenv directly in your test fixtures or conftest.py, or look for actively maintained alternatives that provide the same functionality. ## Install pip install pytest-dotenv uv add pytest-dotenv poetry add pytest-dotenv ## Installing pytest-dotenv Before you install: Installation is straightforward with low friction. However, the package is archived and abandoned—the last release was in 2020, over 2250 days ago. While it has maintained a stable position in the top 5000 PyPI packages, no active maintenance means security updates or compatibility fixes are unlikely. License in practice: Licensed under MIT (permissive), so there are no restrictions on commercial or private use, modification, or redistribution. Quickstart: pip install pytest-dotenv # In pytest.ini or tox.ini: [pytest] env_files = .env # Or run: pytest --envfile .env Requires pytest and python-dotenv as runtime dependencies; no known system-level blockers. Verify before relying: - Whether the package remains compatible with pytest versions released after 2020 - Whether python-dotenv's API changes since 2020 affect this plugin's functionality - Active community forks or maintained alternatives that provide the same functionality ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 5.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest environment variables, load .env file pytest, pytest dotenv plugin, environment configuration testing, pytest env file loader, python-dotenv pytest integration, test environment setup, archived, test-configuration [View on SkillFed](https://skillfed.io/packages/pytest-dotenv) · [View on PyPI](https://pypi.org/project/pytest-dotenv/)