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

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:
NixReaper
2026-09-04 19:45:29 -05:00
co-authored by Claude Sonnet 5
parent 3f6332559a
commit 3acf00e9f0
+3 -7
View File
@@ -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)
assert season_numbers == [0, 1]
# Season stubs have no episodes yet — that's ingest_season's job.
assert all(
(await db_session.execute(select(Episode).where(Episode.season_id == s.id)))
.scalars()
.first()
is None
for s in seasons
)
for season in seasons:
result = await db_session.execute(select(Episode).where(Episode.season_id == season.id))
assert result.scalars().first() is None
@pytest.mark.asyncio