MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_delete

Method test_delete

test/ext/asyncio/test_session.py:592–610  ·  view source on GitHub ↗
(self, async_session)

Source from the content-addressed store, hash-verified

590
591 @async_test
592 async def test_delete(self, async_session):
593 User = self.classes.User
594
595 async with async_session.begin():
596 u1 = User(name="u1")
597
598 async_session.add(u1)
599
600 await async_session.flush()
601
602 conn = await async_session.connection()
603
604 eq_(await conn.scalar(select(func.count(User.id))), 1)
605
606 await async_session.delete(u1)
607
608 await async_session.flush()
609
610 eq_(await conn.scalar(select(func.count(User.id))), 0)
611
612 @async_test
613 async def test_flush(self, async_session):

Callers

nothing calls this directly

Calls 10

eq_Function · 0.90
selectFunction · 0.90
UserClass · 0.50
beginMethod · 0.45
addMethod · 0.45
flushMethod · 0.45
connectionMethod · 0.45
scalarMethod · 0.45
countMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected