11import json
2+ from collections .abc import Awaitable , Callable
23from datetime import date , datetime
3- from typing import Awaitable , Callable , Type , Union
4+ from typing import Union
45
56import pytest
67import sqlalchemy as sa
1617_Login = Callable [[TestClient ], Awaitable [dict [str , str ]]]
1718
1819
19- def test_pk (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
20+ def test_pk (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
2021 class TestModel (base ): # type: ignore[misc,valid-type]
2122 __tablename__ = "dummy"
2223 id : Mapped [int ] = mapped_column (primary_key = True )
@@ -59,7 +60,7 @@ def test_table(mock_engine: AsyncEngine) -> None:
5960 }
6061
6162
62- def test_fk (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
63+ def test_fk (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
6364 class TestModel (base ): # type: ignore[misc,valid-type]
6465 __tablename__ = "dummy"
6566 id : Mapped [int ] = mapped_column (primary_key = True )
@@ -78,7 +79,7 @@ class TestChildModel(base): # type: ignore[misc,valid-type]
7879 "validators" : [("required" ,)]}}
7980
8081
81- def test_relationship (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
82+ def test_relationship (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
8283 class TestMany (base ): # type: ignore[misc,valid-type]
8384 __tablename__ = "many"
8485 id : Mapped [int ] = mapped_column (primary_key = True )
@@ -98,7 +99,7 @@ class TestOne(base): # type: ignore[misc,valid-type]
9899 assert "ones" not in r .inputs
99100
100101
101- def test_check_constraints (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
102+ def test_check_constraints (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
102103 class TestCC (base ): # type: ignore[misc,valid-type]
103104 __tablename__ = "test"
104105 pk : Mapped [int ] = mapped_column (primary_key = True )
@@ -139,7 +140,7 @@ class TestCC(base): # type: ignore[misc,valid-type]
139140 assert f ["regex" ]["validators" ] == [("required" ,), ("regex" , "abc.*" )]
140141
141142
142- async def test_nonid_pk (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
143+ async def test_nonid_pk (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
143144 class TestModel (base ): # type: ignore[misc,valid-type]
144145 __tablename__ = "test"
145146 num : Mapped [int ] = mapped_column (primary_key = True )
@@ -160,7 +161,7 @@ class TestModel(base): # type: ignore[misc,valid-type]
160161 }
161162
162163
163- async def test_id_nonpk (base : Type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
164+ async def test_id_nonpk (base : type [DeclarativeBase ], mock_engine : AsyncEngine ) -> None :
164165 class NotPK (base ): # type: ignore[misc,valid-type]
165166 __tablename__ = "notpk"
166167 name : Mapped [str ] = mapped_column (primary_key = True )
0 commit comments