Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caplog documentation is incorrect #3406

Closed
OrangeDog opened this issue Apr 17, 2018 · 2 comments
Closed

caplog documentation is incorrect #3406

OrangeDog opened this issue Apr 17, 2018 · 2 comments
Labels
plugin: logging related to the logging builtin plugin type: bug problem that needs to be addressed type: docs documentation improvement, missing or needing clarification

Comments

@OrangeDog
Copy link

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

@pytestbot pytestbot added the plugin: logging related to the logging builtin plugin label Apr 17, 2018
@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #584 ("example/special" documentation seems incorrect), #452 (Incorrect capfd description/documentation), #1068 (Wrong documentation), #411 (Documentation: misleading deep inspection), and #538 (Fixture scope documentation).

@pytestbot pytestbot added type: bug problem that needs to be addressed type: docs documentation improvement, missing or needing clarification labels Apr 17, 2018
@rachel1792
Copy link

Yes, you seem to have found an error in the docs. @nicoddemus @RonnyPfannschmidt , can I take a stab at a PR? I'm a first-time contributor :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: logging related to the logging builtin plugin type: bug problem that needs to be addressed type: docs documentation improvement, missing or needing clarification
Projects
None yet
Development

No branches or pull requests

4 participants