From c2e407ef5a54122d83d0e441a835b29efbc46635 Mon Sep 17 00:00:00 2001 From: anand k Date: Sun, 25 Feb 2024 00:24:01 +0530 Subject: [PATCH] Code Quality - included B101 in tox.ini to ignore assert warning --- src/helper_sql.py | 10 +++++----- tox.ini | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/helper_sql.py b/src/helper_sql.py index c9c5c2ab..8dee9e0c 100644 --- a/src/helper_sql.py +++ b/src/helper_sql.py @@ -45,7 +45,7 @@ def sqlQuery(sql_statement, *args): :param list args: SQL query parameters :rtype: list """ - assert sql_available # nosec:B101 + assert sql_available sql_lock.acquire() sqlSubmitQueue.put(sql_statement) @@ -65,7 +65,7 @@ def sqlExecuteChunked(sql_statement, idCount, *args): """Execute chunked SQL statement to avoid argument limit""" # SQLITE_MAX_VARIABLE_NUMBER, # unfortunately getting/setting isn't exposed to python - assert sql_available # nosec:B101 + assert sql_available sqlExecuteChunked.chunkSize = 999 if idCount == 0 or idCount > len(args): @@ -95,7 +95,7 @@ def sqlExecuteChunked(sql_statement, idCount, *args): def sqlExecute(sql_statement, *args): """Execute SQL statement (optionally with arguments)""" - assert sql_available # nosec:B101 + assert sql_available sql_lock.acquire() sqlSubmitQueue.put(sql_statement) @@ -120,7 +120,7 @@ def sqlExecuteScript(sql_statement): def sqlStoredProcedure(procName): """Schedule procName to be run""" - assert sql_available # nosec:B101 + assert sql_available sql_lock.acquire() sqlSubmitQueue.put(procName) if procName == "exit": @@ -143,7 +143,7 @@ class SqlBulkExecute(object): @staticmethod def execute(sql_statement, *args): """Used for statements that do not return results.""" - assert sql_available # nosec:B101 + assert sql_available sqlSubmitQueue.put(sql_statement) if args == (): diff --git a/tox.ini b/tox.ini index c59ae13a..a3cd4044 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ deps = bandit flake8 commands = - bandit -r --exit-zero -s B105,B301,B411,B413,B608 \ + bandit -r --exit-zero -s B105,B301,B411,B413,B608,B101 \ -x checkdeps.*,bitmessagecurses,bitmessageqt,tests pybitmessage flake8 pybitmessage --count --select=E9,F63,F7,F82 \ --show-source --statistics