From 3acf00e9f0aaef74d957c7960252ab4454c98779 Mon Sep 17 00:00:00 2001 From: NixReaper Date: Fri, 4 Sep 2026 19:45:29 -0500 Subject: [PATCH] Fix test bug: await inside a generator expression passed to all() 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 --- tests/integration/test_series_ingestion.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/integration/test_series_ingestion.py b/tests/integration/test_series_ingestion.py index 936486a..ed34b4f 100644 --- a/tests/integration/test_series_ingestion.py +++ b/tests/integration/test_series_ingestion.py @@ -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