Skip to content

Commit

Permalink
Add SQLAlchemy .in_ operator test case for #577
Browse files Browse the repository at this point in the history
  • Loading branch information
Nothing4You committed Sep 3, 2022
1 parent ab13f94 commit fe98dd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/sa/test_sa_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,17 @@ async def test_async_iter(sa_connect):
async for row in conn.execute(tbl.select()):
ret.append(row)
assert [(1, "first"), (2, "second")] == ret


@pytest.mark.run_loop
async def test_statement_in(sa_connect):
conn = await sa_connect()
await conn.execute(tbl.insert().values(name="second"))
await conn.execute(tbl.insert().values(name="third"))

stmt = tbl.select().where(tbl.c.id.in_([1, 2]))

ret = []
async for row in conn.execute(stmt):
ret.append(row)
assert [(1, "first"), (2, "second")] == ret

0 comments on commit fe98dd1

Please sign in to comment.