aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/api/utils
diff options
context:
space:
mode:
s='add'>+ mock_parser.NoOptionError = ConfigParser.NoOptionError
try:
influx.get_data_db_client()
except Exception as e:
@@ -67,6 +73,9 @@ class QueryTestCase(unittest.TestCase):
@mock.patch('api.utils.influx.ConfigParser')
def test_query_dispatcher_not_influxdb(self, mock_parser):
mock_parser.ConfigParser().get.return_value = 'file'
+ # reset exception to avoid
+ # TypeError: catching classes that do not inherit from BaseException
+ mock_parser.NoOptionError = ConfigParser.NoOptionError
try:
sql = 'select * form tasklist'
influx.query(sql)