Skip to content

document how to handle minversion= in pyproject.toml #7730

@graingert

Description

@graingert

currently minversion pyproject.toml[[tool.pytest.ini_options]minversion doesn't apply when running on pytest<6 because those versions don't parse the file.

I've found a work-around using a setup.cfg because pyproject.toml takes priority over setup.cfg:

# pyproject.toml
[tool.pytest.ini_options]
minversion = "6.0"
# setup.cfg
[tool:pytest]
minversion = 6

secondly it would be useful if pyproject.toml took priority over pytest.ini to allow pytest 4-6 to have forward compatibility using pytest.ini instead of setup.cfg which have meanings to other tools

This is not possible to do in a plugin, because minversion is useful assuming you do not have control of the packages installed yet.

see #7653 for https://pypi.org/project/pytest-forward-compatibility/

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: configrelated to config handling, argument parsing and config filetype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions