test: py: Fix log level restore in SimpleTestMethods()

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: 06cb7130c4 ("py: Add unittests.py")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2024-11-05 02:03:14 +02:00
parent 7ff6fd9774
commit 876730d805

View file

@ -66,7 +66,7 @@ class SimpleTestMethods(BaseTestCase):
libcam.log_set_level('Camera', 'FATAL') libcam.log_set_level('Camera', 'FATAL')
with self.assertRaises(RuntimeError): with self.assertRaises(RuntimeError):
cam.acquire() cam.acquire()
libcam.log_set_level('Camera', 'ERROR') libcam.log_set_level('Camera', 'INFO')
cam.release() cam.release()