1212from sqlalchemy .ext .asyncio import create_async_engine
1313from sqlalchemy .pool import AsyncAdaptedQueuePool , NullPool , QueuePool
1414
15- from psqlpy_sqlalchemy .dialect import PSQLPyAsyncDialect , PsqlpyDialect , CompatibleNullPool
15+ from psqlpy_sqlalchemy .dialect import (
16+ CompatibleNullPool ,
17+ PSQLPyAsyncDialect ,
18+ PsqlpyDialect ,
19+ )
1620
1721
1822class TestPoolclassCompatibility (unittest .TestCase ):
@@ -223,7 +227,9 @@ def test_compatible_nullpool_with_pool_args_sync(self):
223227 except Exception as e :
224228 # Connection errors are acceptable, we're testing pool creation
225229 if "Invalid argument(s)" in str (e ):
226- self .fail (f"CompatibleNullPool should accept pool arguments: { e } " )
230+ self .fail (
231+ f"CompatibleNullPool should accept pool arguments: { e } "
232+ )
227233
228234 def test_compatible_nullpool_with_pool_args_async (self ):
229235 """Test that CompatibleNullPool works with pool arguments in async engines"""
@@ -238,13 +244,16 @@ async def _test_compatible_nullpool():
238244 )
239245 self .assertIsNotNone (self .async_engine )
240246 self .assertEqual (
241- self .async_engine .sync_engine .pool .__class__ , CompatibleNullPool
247+ self .async_engine .sync_engine .pool .__class__ ,
248+ CompatibleNullPool ,
242249 )
243250 return True
244251 except Exception as e :
245252 # Connection errors are acceptable, we're testing pool creation
246253 if "Invalid argument(s)" in str (e ):
247- self .fail (f"CompatibleNullPool should accept pool arguments: { e } " )
254+ self .fail (
255+ f"CompatibleNullPool should accept pool arguments: { e } "
256+ )
248257 return True
249258
250259 loop = asyncio .new_event_loop ()
@@ -270,7 +279,9 @@ def test_compatible_nullpool_ignores_pool_args(self):
270279 except Exception as e :
271280 # Connection errors are acceptable
272281 if "Invalid argument(s)" in str (e ):
273- self .fail (f"CompatibleNullPool should ignore pool arguments: { e } " )
282+ self .fail (
283+ f"CompatibleNullPool should ignore pool arguments: { e } "
284+ )
274285
275286 def test_regular_nullpool_still_fails_with_pool_args (self ):
276287 """Test that regular NullPool still fails with pool arguments (regression test)"""
@@ -281,8 +292,11 @@ def test_regular_nullpool_still_fails_with_pool_args(self):
281292 pool_size = 5 ,
282293 max_overflow = 10 ,
283294 )
284-
285- self .assertIn ("Invalid argument(s) 'pool_size','max_overflow'" , str (context .exception ))
295+
296+ self .assertIn (
297+ "Invalid argument(s) 'pool_size','max_overflow'" ,
298+ str (context .exception ),
299+ )
286300
287301
288302class TestFastAPIMiddlewareCompatibility (unittest .TestCase ):
0 commit comments