diff --git a/_pytest/logging.py b/_pytest/logging.py index 902872e45..2f50192c3 100644 --- a/_pytest/logging.py +++ b/_pytest/logging.py @@ -289,9 +289,9 @@ def caplog(request): 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.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 """ result = LogCaptureFixture(request.node) diff --git a/changelog/3406.doc.rst b/changelog/3406.doc.rst new file mode 100644 index 000000000..e6f0f7462 --- /dev/null +++ b/changelog/3406.doc.rst @@ -0,0 +1 @@ +Fix typo in ``caplog`` fixture documentation, which incorrectly identified certain attributes as methods. diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 506c613e5..554cf59b2 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -77,9 +77,9 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a 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.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 monkeypatch The returned ``monkeypatch`` fixture provides these