Skip to content

caplog documentation is incorrect #3406

@OrangeDog

Description

@OrangeDog

As seen here: https://docs.pytest.org/en/latest/builtin.html

caplog
    Access and control log capturing.

    Captured logs are available through the following methods::

    * caplog.text()          -> string containing formatted log output
    * caplog.records()       -> list of logging.LogRecord instances
    * caplog.record_tuples() -> list of (logger_name, level, message) tuples
    * caplog.clear()         -> clear captured records and formatted log output string

However, text, records and record_tuples are properties. Using them as described results in an exception:

TypeError: 'list' object is not callable

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: loggingrelated to the logging builtin plugintype: bugproblem that needs to be addressedtype: 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