From patchwork Tue Nov 5 00:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21808 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8C3DFBDC71 for ; Tue, 5 Nov 2024 00:07:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D7881653E4; Tue, 5 Nov 2024 01:07:10 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SBuNZjc5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A88E65399 for ; Tue, 5 Nov 2024 01:07:09 +0100 (CET) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C091F4AD; Tue, 5 Nov 2024 01:07:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1730765222; bh=GUw4bQkbQvtCe4JBfPFK9EkKFmmbvDQmfKm5TIHNVZc=; h=From:To:Cc:Subject:Date:From; b=SBuNZjc5osugRk3PRr/p4NsuzDXFqgxCYt2GNZQ1KfV8gYvvrIkcy4szisOfl9gzq TOFw+pobbIe8C/so1FoWJLUDlVylCjDz8s9mCnmXCxFzbuQYfVGShhtosGoJYB+nJJ yQJni0nAuVzh24nHody1lfimafw8JMw6xZdx19F8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Tomi Valkeinen Subject: [PATCH] test: py: Fix log level restore in SimpleTestMethods() Date: Tue, 5 Nov 2024 02:07:03 +0200 Message-ID: <20241105000703.22037-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The SimpleTestMethods() function tests that incorrect calls to the Camera.acquire() method raise an exception. Before doing so, it sets the log level for the Camera category to FATAL, in order to avoid showing misleading errors in the test log, and then restores the log level to ERROR after running the test. ERROR is however not the default log level. Restore the log level to INFO instead, in order to avoid losing log messages in subsequent tests. Fixes: 06cb7130c4fa ("py: Add unittests.py") Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Tomi Valkeinen --- test/py/unittests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: f028b09b7becf4e7847112b2e8044e5e30e01c58 diff --git a/test/py/unittests.py b/test/py/unittests.py index 1caea98eb946..8cb850d4e71c 100755 --- a/test/py/unittests.py +++ b/test/py/unittests.py @@ -66,7 +66,7 @@ class SimpleTestMethods(BaseTestCase): libcam.log_set_level('Camera', 'FATAL') with self.assertRaises(RuntimeError): cam.acquire() - libcam.log_set_level('Camera', 'ERROR') + libcam.log_set_level('Camera', 'INFO') cam.release()