# What changed in pytest-env

> 11 changes in pytest-env 1 from its official release notes, upgrade guides and advisories: 1 breaking, 6 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/pypi/pytest-env/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## pytest-env 1

### Breaking changes

- Python 3.11 is now required, and the default Python version is 3.15. (1.8.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.8.0)

### New APIs and options

- Adds a flag for debugging environment assignments. (1.5.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.5.0)
- Adds the --envfile option for switching runtime environments. (1.4.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.4.0)
- pytest-env adds support for loading environment variables from .env files. (1.3.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.3.0)
- pytest-env supports pytest.toml and .pytest.toml configuration files. (1.3.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.3.0)
- pytest-env supports configuration in the [tool.pytest] section of pyproject.toml. (1.3.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.3.0)
- The U flag unsets environment variables. (1.3.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.3.0)

### Behavior and default changes

- Preserves existing environment variable values when pytest-env sets environment variables. (1.6.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.6.0)
- TOML file discovery now uses inipath. (1.3.0) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.3.0)

### Fixes and other changes

- An explicitly empty native env_files setting now takes precedence over the INI fallback. (1.8.1) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.8.1)
- Fixes verbose source attribution when falling back to INI environment variables. (1.5.1) — [release notes](https://github.com/pytest-dev/pytest-env/releases/tag/1.5.1)
