Quiten boto logging in func tests

Some s3api functional tests were setting boto logging level to DEBUG,
which results in a very large amount of logging output from the test
runner, including large request bodies. This makes it extremely hard
to inspect test output.
This patch makes the quiet_boto_logging context manager revert the
logger level to its original value rather than indiscriminately
leaving it set to DEBUG.
Change-Id: I1dd9603adf9a19e89da5a461d3c6810a3432ae46
This commit is contained in:
Alistair Coles
2024年09月20日 15:59:04 +01:00
parent e0a9ea496e
commit 60c0ab2ea0

View File

@@ -45,11 +45,12 @@ class S3ApiBase(unittest.TestCase):
@contextmanager
def quiet_boto_logging(self):
original_level = logging.getLogger('boto').getEffectiveLevel()
try:
logging.getLogger('boto').setLevel(logging.INFO)
yield
finally:
logging.getLogger('boto').setLevel(logging.DEBUG)
logging.getLogger('boto').setLevel(original_level)
def setUp(self):
if not tf.config.get('s3_access_key'):
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.