Skip to content

Verbose output attributes env overrides to the config file #343

Closed

Description

@gaborbernat

The verbose header names the selected configuration file for an assignment supplied with -o env. The test process receives the override.

Affected code

Configuration handling at ac5583c

Mechanism

_config_source chooses a file path before reading the effective env list. pytest applies -o when reading that list. Reference

Reproduction

Run at ac5583cb5181 with pytest 9.2.0 in an empty directory on Linux.

printf '[pytest]\nenv = MODE=file\n' > pytest.ini
pytest --pytest-env-verbose -o env=MODE=override

Observed output (path abbreviated):

SET   MODE=override  (from …/pytest.ini)

Name the override as the source.

Impact

Easy to reproduce. Exposure is niche because the incorrect label requires both an override and verbose output.

Credits

OSS Scanner report ANT-2026-QZ2QBYAJ.

Activity

  1. added
    bug
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions