Skip to content

[BUG] testdir fixture usage seems to cause PytestDeprecationWarning: The TerminalReporter.writer attribute is deprecated, use TerminalReporter._tw instead at your own risk. #7328

@webknjaz

Description

@webknjaz

While implementing pytest-dev/pytest-forked#34, I've faced this, when writing tests for the plugin:

  $PYTHON_PREFIX/lib/python3.8/site-packages/_pytest/compat.py:333: PytestDeprecationWarning: The TerminalReporter.writer attribute is deprecated, use TerminalReporter._tw instead at your own risk.
  See https://docs.pytest.org/en/latest/deprecations.html#terminalreporter-writer for more information.
    return getattr(object, name, default)

It's funny that the docs even showcase this exact warning in the test report snippet in this section: https://docs.pytest.org/en/stable/writing_plugins.html#testing-plugins.

N.B. I'm currently unable to determine what exactly triggers this because of the dynamic getattr().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions