Fix test bug: await inside a generator expression passed to all()
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
Python turns a generator expression containing await into an async generator (since it's evaluated inside an async def), which the built-in all() can't consume -- it raised "TypeError: 'async_generator' object is not iterable" rather than testing anything. Replaced with a plain loop. Found by actually running the new integration tests. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
3f6332559a
commit
3acf00e9f0
@@ -61,13 +61,9 @@ async def test_ingest_series_creates_series_and_season_stubs(db_session: AsyncSe
|
|||||||
season_numbers = sorted(s.season_number for s in seasons)
|
season_numbers = sorted(s.season_number for s in seasons)
|
||||||
assert season_numbers == [0, 1]
|
assert season_numbers == [0, 1]
|
||||||
# Season stubs have no episodes yet — that's ingest_season's job.
|
# Season stubs have no episodes yet — that's ingest_season's job.
|
||||||
assert all(
|
for season in seasons:
|
||||||
(await db_session.execute(select(Episode).where(Episode.season_id == s.id)))
|
result = await db_session.execute(select(Episode).where(Episode.season_id == season.id))
|
||||||
.scalars()
|
assert result.scalars().first() is None
|
||||||
.first()
|
|
||||||
is None
|
|
||||||
for s in seasons
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
Reference in New Issue
Block a user