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

Method test_flush

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

Source from the content-addressed store, hash-verified

611
612 @async_test
613 async def test_flush(self, async_session):
614 User = self.classes.User
615
616 async with async_session.begin():
617 u1 = User(name="u1")
618
619 async_session.add(u1)
620
621 conn = await async_session.connection()
622
623 eq_(await conn.scalar(select(func.count(User.id))), 0)
624
625 await async_session.flush()
626
627 eq_(await conn.scalar(select(func.count(User.id))), 1)
628
629 @async_test
630 async def test_refresh(self, async_session):

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected