Fix unit tests when they are run with OS_DEBUG=True
This patch fix test_default_logging test.
The test validates that we have two logging handlers:
1 x to display default messages (info, error, warnings...)
1 x to redirect debug messages to null and so don't display them.
However, if OS_DEBUG=True is set in a shell session, then the test is
run and fails. Because, in debug mode, we should have only one handler
to display all messages. (look at comments for more details and
test_debug_logging test).
To fix the test, we explicitly set OS_DEBUG=0 when running
test_default_logging, so it will ensure we have two handlers whatever
OS_DEBUG value.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /833115 /opendev. org/openstack/ nova/commit/ 84c6d05ac343029 cf151c35d4696ce e0dc74f2c9
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 84c6d05ac343029 cf151c35d4696ce e0dc74f2c9
Author: Artom Lifshitz <email address hidden>
Date: Thu Mar 10 10:53:13 2022 -0500
Fix unit tests when they are run with OS_DEBUG=True
This patch fix test_default_ logging test.
The test validates that we have two logging handlers:
1 x to display default messages (info, error, warnings...)
1 x to redirect debug messages to null and so don't display them.
However, if OS_DEBUG=True is set in a shell session, then the test is debug_logging test).
run and fails. Because, in debug mode, we should have only one handler
to display all messages. (look at comments for more details and
test_
To fix the test, we explicitly set OS_DEBUG=0 when running default_ logging, so it will ensure we have two handlers whatever
test_
OS_DEBUG value.
Co-authored-by: Rene Ribaud <email address hidden>
Closes-Bug: #1964497
Change-Id: I7c0151d988c538 dd2d083aab4b3e1 8ddb8151045