From 19855db9554a874d06f8e648c3cca676e59517f2 Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Fri, 27 May 2022 15:53:06 +1000 Subject: [PATCH] pytest: explicitly set system logger to DEBUG We had a test grab the system logger via logging.getLogger() but when running under pytest it isn't returned at the DEBUG level as it does in nosetests. This patch updates the test to set the level to DEBUG explicitly and allows the only unit test that fails `pytest test/unit` to pass. Change-Id: I1c93136cd13e927a2deb380a95fb9f96ec79fa30 --- test/unit/common/test_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index 40a34fe8d8..ed43a4b495 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -1548,6 +1548,7 @@ class TestUtils(unittest.TestCase): self.handleError(record) logger = logging.getLogger() + logger.setLevel(logging.DEBUG) handler = CrashyLogger() logger.addHandler(handler)