MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_one_no_result

Method test_one_no_result

test/ext/asyncio/test_engine.py:1418–1428  ·  view source on GitHub ↗
(self, async_engine)

Source from the content-addressed store, hash-verified

1416
1417 @async_test
1418 async def test_one_no_result(self, async_engine):
1419 users = self.tables.users
1420 async with async_engine.connect() as conn:
1421 result = await conn.stream(
1422 select(users).where(users.c.user_name == "nonexistent")
1423 )
1424
1425 with expect_raises_message(
1426 exc.NoResultFound, "No row was found when one was required"
1427 ):
1428 await result.one()
1429
1430 @async_test
1431 async def test_one_multi_result(self, async_engine):

Callers

nothing calls this directly

Calls 6

selectFunction · 0.90
expect_raises_messageFunction · 0.90
connectMethod · 0.45
streamMethod · 0.45
whereMethod · 0.45
oneMethod · 0.45

Tested by

no test coverage detected