From db6457bfbcccce35162d9d2ece988c7c8c8f9308 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 6 Apr 2023 12:43:56 +0300 Subject: Fix linting issues --- tests/integration/conftest.py | 2 +- tests/unit/test_db_utils.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 795c42d..8e39726 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -18,7 +18,7 @@ def client(): @pytest.fixture(scope="session") -def db_conn(client): +def db_conn(client): # pylint: disable=[redefined-outer-name] """Create a db connection fixture for tests""" # 01) Generate random string to append to all test db artifacts for the session live_db_uri = client.application.config["SQL_URI"] diff --git a/tests/unit/test_db_utils.py b/tests/unit/test_db_utils.py index 0211107..beb7169 100644 --- a/tests/unit/test_db_utils.py +++ b/tests/unit/test_db_utils.py @@ -3,7 +3,6 @@ from unittest import mock import pytest -import gn3 from gn3.db_utils import parse_db_url, database_connection @pytest.mark.unit_test @@ -11,11 +10,9 @@ from gn3.db_utils import parse_db_url, database_connection @mock.patch("gn3.db_utils.parse_db_url") def test_database_connection(mock_db_parser, mock_sql): """test for creating database connection""" - print(f"MOCK SQL: {mock_sql}") - print(f"MOCK DB PARSER: {mock_db_parser}") mock_db_parser.return_value = ("localhost", "guest", "4321", "users", None) - with database_connection("mysql://guest:4321@localhost/users") as conn: + with database_connection("mysql://guest:4321@localhost/users") as _conn: mock_sql.connect.assert_called_with( db="users", user="guest", passwd="4321", host="localhost", port=3306) -- cgit v1.2.3