From 8c1d6a82fa76cf07ee8b5e6d71977f6f4d654955 Mon Sep 17 00:00:00 2001 From: ChristineTChen Date: Wed, 28 Jul 2021 19:59:16 -0400 Subject: [PATCH] Fix style --- ibm_db2/datadog_checks/ibm_db2/ibm_db2.py | 2 +- ibm_db2/tests/test_unit.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ibm_db2/datadog_checks/ibm_db2/ibm_db2.py b/ibm_db2/datadog_checks/ibm_db2/ibm_db2.py index 490c0804d0c87..a55f9b12f7c2b 100644 --- a/ibm_db2/datadog_checks/ibm_db2/ibm_db2.py +++ b/ibm_db2/datadog_checks/ibm_db2/ibm_db2.py @@ -72,7 +72,7 @@ def check(self, instance): ): try: query_method() - except ConnectionError as e: + except ConnectionError: raise except Exception as e: self.log.warning('Encountered error running `%s`: %s', query_method.__name__, str(e)) diff --git a/ibm_db2/tests/test_unit.py b/ibm_db2/tests/test_unit.py index a507fa1b89f11..6faad887b2692 100644 --- a/ibm_db2/tests/test_unit.py +++ b/ibm_db2/tests/test_unit.py @@ -47,8 +47,10 @@ def mock_exception(*args, **kwargs): def test_query_function_error(aggregator, instance): - exception_msg = '[IBM][CLI Driver][DB2/NT64] SQL0440N No authorized routine named "MON_GET_INSTANCE" of type ' \ - '"FUNCTION" having compatible arguments was found. SQLSTATE=42884' + exception_msg = ( + '[IBM][CLI Driver][DB2/NT64] SQL0440N No authorized routine named "MON_GET_INSTANCE" of type ' + '"FUNCTION" having compatible arguments was found. SQLSTATE=42884' + ) def query_instance(*args, **kwargs): raise Exception(exception_msg)