pypi / pytest-env
pytest-env
What changed in pytest-env 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
1 breaking6 new APIs and options2 behavior and defaults2 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpytest-env 111 changes
Breaking changes 1
Python 3.11 is now required, and the default Python version is 3.15.
New APIs and options 6
Adds a flag for debugging environment assignments.
Adds the --envfile option for switching runtime environments.
pytest-env adds support for loading environment variables from .env files.
pytest-env supports pytest.toml and .pytest.toml configuration files.
pytest-env supports configuration in the [tool.pytest] section of pyproject.toml.
The U flag unsets environment variables.
Behavior and default changes 2
Preserves existing environment variable values when pytest-env sets environment variables.
TOML file discovery now uses inipath.
Fixes and other changes 2
An explicitly empty native env_files setting now takes precedence over the INI fallback.
Fixes verbose source attribution when falling back to INI environment variables.