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

Comments

Projects
None yet
4 participants
@OrangeDog

OrangeDog commented Apr 17, 2018

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

This comment has been minimized.

pytestbot commented Apr 17, 2018

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).

@rachel1792

This comment has been minimized.

Member

rachel1792 commented Apr 17, 2018

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 :)

nicoddemus added a commit that referenced this issue Apr 20, 2018

Merge pull request #3407 from rachel1792/master
Fix typo in caplog fixture documentation: Issue #3406

@nicoddemus nicoddemus closed this Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment