Skip to content

Commit

Permalink
Fixed mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Dec 30, 2024
1 parent d3af4d1 commit b29faf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from contextlib import AsyncExitStack
from pathlib import Path
from threading import Thread, current_thread
from typing import Any
from typing import Any, cast

import pytest
from asphalt.core import (
Expand Down Expand Up @@ -151,7 +151,7 @@ async def test_close_twice_sync(psycopg_url: str) -> None:
await component.start()
session = get_resource_nowait(Session)
assert isinstance(session.bind, Engine)
pool = session.bind.pool
pool = cast(QueuePool, session.bind.pool)
assert isinstance(pool, QueuePool)
session.execute(text("SELECT 1"))
assert pool.checkedout() == 1
Expand All @@ -170,7 +170,7 @@ async def test_close_twice_async(psycopg_url_async: str) -> None:
await component.start()
session = get_resource_nowait(AsyncSession)
assert isinstance(session.bind, AsyncEngine)
pool = session.bind.pool
pool = cast(QueuePool, session.bind.pool)
assert isinstance(pool, AsyncAdaptedQueuePool)
await session.execute(text("SELECT 1"))
assert pool.checkedout() == 1
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def connection(sync_engine: Engine) -> Generator[Connection, Any, None]:
Table("table", metadata, Column("column1", Integer, primary_key=True))
Table("table2", metadata, Column("fk_column", ForeignKey("table.column1")))
if conn.dialect.name != "sqlite":
conn.execute(CreateSchema("altschema")) # type: ignore[no-untyped-call]
conn.execute(CreateSchema("altschema"))
Table("table3", metadata, Column("fk_column", Integer), schema="altschema")

metadata.create_all(conn)
Expand All @@ -28,7 +28,7 @@ def connection(sync_engine: Engine) -> Generator[Connection, Any, None]:

if conn.dialect.name != "sqlite":
metadata.drop_all(conn)
conn.execute(DropSchema("altschema")) # type: ignore[no-untyped-call]
conn.execute(DropSchema("altschema"))


def test_clear_database(connection: Connection) -> None:
Expand Down

0 comments on commit b29faf5

Please sign in to comment.