@@ -166,26 +166,26 @@ def pg_sa_engine(
166166
167167
168168@pytest .fixture
169- async def pg_engine (
169+ async def aiopg_engine (
170170 pg_sa_engine : sa .engine .Engine , make_engine : Callable
171171) -> AsyncIterator [Engine ]:
172172 """
173173 Return an aiopg.sa engine connected to a responsive and migrated pg database
174174 """
175- async_engine = await make_engine (is_async = True )
175+ aiopg_sa_engine = await make_engine (is_async = True )
176176
177- yield async_engine
177+ yield aiopg_sa_engine
178178
179179 # closes async-engine connections and terminates
180- async_engine .close ()
181- await async_engine .wait_closed ()
182- async_engine .terminate ()
180+ aiopg_sa_engine .close ()
181+ await aiopg_sa_engine .wait_closed ()
182+ aiopg_sa_engine .terminate ()
183183
184184
185185@pytest .fixture
186- async def connection (pg_engine : Engine ) -> AsyncIterator [SAConnection ]:
186+ async def connection (aiopg_engine : Engine ) -> AsyncIterator [SAConnection ]:
187187 """Returns an aiopg.sa connection from an engine to a fully furnished and ready pg database"""
188- async with pg_engine .acquire () as _conn :
188+ async with aiopg_engine .acquire () as _conn :
189189 yield _conn
190190
191191
@@ -264,7 +264,7 @@ async def _creator(conn, group: RowProxy | None = None, **overrides) -> RowProxy
264264
265265@pytest .fixture
266266async def create_fake_cluster (
267- pg_engine : Engine , faker : Faker
267+ aiopg_engine : Engine , faker : Faker
268268) -> AsyncIterator [Callable [..., Awaitable [int ]]]:
269269 cluster_ids = []
270270 assert cluster_to_groups is not None
@@ -278,7 +278,7 @@ async def _creator(**overrides) -> int:
278278 "authentication" : faker .pydict (value_types = [str ]),
279279 }
280280 insert_values .update (overrides )
281- async with pg_engine .acquire () as conn :
281+ async with aiopg_engine .acquire () as conn :
282282 cluster_id = await conn .scalar (
283283 clusters .insert ().values (** insert_values ).returning (clusters .c .id )
284284 )
@@ -289,13 +289,13 @@ async def _creator(**overrides) -> int:
289289 yield _creator
290290
291291 # cleanup
292- async with pg_engine .acquire () as conn :
292+ async with aiopg_engine .acquire () as conn :
293293 await conn .execute (clusters .delete ().where (clusters .c .id .in_ (cluster_ids )))
294294
295295
296296@pytest .fixture
297297async def create_fake_project (
298- pg_engine : Engine ,
298+ aiopg_engine : Engine ,
299299) -> AsyncIterator [Callable [..., Awaitable [RowProxy ]]]:
300300 created_project_uuids = []
301301
@@ -312,7 +312,7 @@ async def _creator(conn, user: RowProxy, **overrides) -> RowProxy:
312312
313313 yield _creator
314314
315- async with pg_engine .acquire () as conn :
315+ async with aiopg_engine .acquire () as conn :
316316 await conn .execute (
317317 projects .delete ().where (projects .c .uuid .in_ (created_project_uuids ))
318318 )
0 commit comments