MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_inspect_session

Method test_inspect_session

test/ext/asyncio/test_session.py:1122–1140  ·  view source on GitHub ↗
(self, async_engine)

Source from the content-addressed store, hash-verified

1120
1121 @async_test
1122 async def test_inspect_session(self, async_engine):
1123 User = self.classes.User
1124
1125 s1 = AsyncSession(async_engine)
1126
1127 s2 = AsyncSession(async_engine)
1128
1129 u1 = await s1.get(User, 7)
1130
1131 u2 = User(name="n1")
1132
1133 s2.add(u2)
1134
1135 u3 = User(name="n2")
1136
1137 is_(inspect(u1).async_session, s1)
1138 is_(inspect(u2).async_session, s2)
1139
1140 is_(inspect(u3).async_session, None)
1141
1142 def test_inspect_session_no_asyncio_used(self):
1143 User = self.classes.User

Callers

nothing calls this directly

Calls 6

getMethod · 0.95
addMethod · 0.95
AsyncSessionClass · 0.90
is_Function · 0.90
inspectFunction · 0.90
UserClass · 0.50

Tested by

no test coverage detected