Skip to content

py312: latest pytest still throws deprecations warnings with py312 #11515

@ssbarnea

Description

@ssbarnea

At this moment both pytest main branch and latest release (7.4.2) do still produce deprecation warnings when run under pytest 3.12 and that is a problem for anyone that is following the practice of treating warnings as errors during testing.

I already seen projects going the long route of disabling these but the better approach is to address them and ensure that current versions do not produce them.

Example: https://sourcegraph.com/github.com/home-assistant/core/-/blob/pyproject.toml?L495-496

  .tox/py/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:916: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
    template = ast.BinOp(assertmsg, ast.Add(), ast.Str(explanation))

Latest stable version, should not produce any deprecation warnings coming directly from its own code with py312.

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