MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_with_for_update_async

Function test_with_for_update_async

test/typing/plain_files/orm/session.py:150–168  ·  view source on GitHub ↗

test #9762

()

Source from the content-addressed store, hash-verified

148
149
150async def test_with_for_update_async() -> None:
151 """test #9762"""
152 sess = AsyncSession()
153 ss = async_scoped_session(
154 async_sessionmaker(), scopefunc=asyncio.current_task
155 )
156
157 await sess.get(User, 1)
158 await sess.get(User, 1, with_for_update=True)
159
160 await ss.get(User, 1)
161 await ss.get(User, 1, with_for_update=True)
162
163 u1 = User()
164 await sess.refresh(u1)
165 await sess.refresh(u1, with_for_update=True)
166
167 await ss.refresh(u1)
168 await ss.refresh(u1, with_for_update=True)
169
170
171def test_exec_options() -> None:

Callers

nothing calls this directly

Calls 8

getMethod · 0.95
refreshMethod · 0.95
AsyncSessionClass · 0.90
async_sessionmakerClass · 0.90
UserClass · 0.70
getMethod · 0.45
refreshMethod · 0.45

Tested by

no test coverage detected