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:
1 changed files with 2 additions and 1 deletions
@@ -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
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.