Skip to content

Commit

Permalink
Fixing some lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
cecily_carver committed Dec 19, 2024
1 parent fbf5a11 commit 83672ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion mysql_mimic/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def like_to_regex(like: str) -> re.Pattern:
return re.compile(like)


def contains_column_metadata(schema, depth) -> bool:
def contains_column_metadata(schema: dict, depth: int) -> bool:
sub_dict = schema

# Find the innermost dictionary.
Expand Down
19 changes: 3 additions & 16 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from contextlib import closing
from typing import Optional, Tuple, List, Dict
from typing import Optional, Tuple, Dict

import pytest
from mysql.connector import DatabaseError
from mysql.connector.abstracts import MySQLConnectionAbstract
from mysql.connector.plugins.mysql_clear_password import MySQLClearPasswordAuthPlugin

from mysql_mimic import User, MysqlServer
from mysql_mimic import User
from mysql_mimic.auth import (
NativePasswordAuthPlugin,
AbstractClearPasswordAuthPlugin,
AuthPlugin,
NoLoginAuthPlugin,
)
from tests.conftest import query, to_thread, MockSession, ConnectFixture
from tests.conftest import query, to_thread, ConnectFixture

# mysql.connector throws an error if you try to use mysql_clear_password without SSL.
# That's silly, since SSL termination doesn't have to be handled by MySQL.
Expand Down Expand Up @@ -97,10 +96,7 @@ def users() -> Dict[str, User]:
],
)
async def test_auth(
server: MysqlServer,
session: MockSession,
connect: ConnectFixture,
auth_plugins: List[AuthPlugin],
username: str,
password: Optional[str],
auth_plugin: Optional[str],
Expand All @@ -119,10 +115,7 @@ async def test_auth(
],
)
async def test_auth_secondary_password(
server: MysqlServer,
session: MockSession,
connect: ConnectFixture,
auth_plugins: List[AuthPlugin],
) -> None:
with closing(
await connect(
Expand Down Expand Up @@ -153,10 +146,7 @@ async def test_auth_secondary_password(
],
)
async def test_change_user(
server: MysqlServer,
session: MockSession,
connect: ConnectFixture,
auth_plugins: List[AuthPlugin],
user1: Tuple[str, str, str],
user2: Tuple[str, str, str],
) -> None:
Expand Down Expand Up @@ -195,10 +185,7 @@ async def test_change_user(
],
)
async def test_access_denied(
server: MysqlServer,
session: MockSession,
connect: ConnectFixture,
auth_plugins: Optional[List[AuthPlugin]],
username: Optional[str],
password: Optional[str],
auth_plugin: Optional[str],
Expand Down
3 changes: 0 additions & 3 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
async def query_fixture(
mysql_connector_conn: MySQLConnectionAbstract,
aiomysql_conn: aiomysql.Connection,
session: MockSession,
sqlalchemy_engine: AsyncEngine,
request: Any,
) -> QueryFixture:
Expand Down Expand Up @@ -154,7 +153,6 @@ async def q4(sql: str) -> Sequence[Dict[str, Any]]:
)
async def test_query(
session: MockSession,
server: MysqlServer,
rv: AllowedResult,
expected: List[Dict[str, Any]],
query_fixture: QueryFixture,
Expand Down Expand Up @@ -204,7 +202,6 @@ async def test_query(
)
async def test_prepared_stmt(
session: MockSession,
server: MysqlServer,
mysql_connector_conn: MySQLConnectionAbstract,
sql: str,
params: Tuple[Any],
Expand Down

0 comments on commit 83672ea

Please sign in to comment.