Skip to content

partial-pytest.json: Missing support for "tool.pytest.ini_options" #5145

@anusshukla

Description

@anusshukla

Area with issue?

JSON Schema

✔️ Expected Behavior

The schema should accept [tool.pytest.ini_options] as valid configuration, since this is the official and documented way to configure pytest in pyproject.toml since pytest 6.0+ (released in 2020).

Pytest Official Documentation: https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml

❌ Actual Behavior

Tools that use the schema for validation (such as tombi-lint in strict mode) reject valid pytest configurations with this error:

Warning: In strict mode, tool.pytest does not allow "ini_options" key.

Please add "additionalProperties": true to the location where tool.pytest is defined in https://json.schemastore.org/partial-pytest.json

This affects major projects including:

  • ansible-lint (3.8k stars)
  • molecule (4k stars)
  • Many other pytest users with pyproject.toml configuration

JSON, YAML, or TOML file that does not work.

[tool.pytest.ini_options]
addopts = "-p no:pytest_cov --durations=10"
testpaths = ["tests"]
python_files = ["test_*.py"]
filterwarnings = ["error"]

IDE or code editor.

None

Are you making a PR for this?

Yes, I will create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions