From 2fcf21a6c7c3b77f7284fdc9bd11b06bed257c59 Mon Sep 17 00:00:00 2001 From: James Cooke Date: Fri, 20 Sep 2019 18:36:25 +0100 Subject: [PATCH] Fix logging doc: change x.level to x.levelno --- doc/en/logging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/logging.rst b/doc/en/logging.rst index c32205f13..e6f91cdf7 100644 --- a/doc/en/logging.rst +++ b/doc/en/logging.rst @@ -161,7 +161,7 @@ the records for the ``setup`` and ``call`` stages during teardown like so: yield window for when in ("setup", "call"): messages = [ - x.message for x in caplog.get_records(when) if x.level == logging.WARNING + x.message for x in caplog.get_records(when) if x.levelno == logging.WARNING ] if messages: pytest.fail(