Skip to content

review_service unit tests misconfigure async mocks — 13 of 19 tests fail #65

Description

@Aburke225

The service code correctly awaits db.execute(...), but the tests build their mock session so that result.scalars() returns a coroutine, causing AttributeError: 'coroutine' object has no attribute 'first' (and 'all') inside otherwise-correct service code. Rework the mock setup (e.g. AsyncMock for execute, MagicMock for the result object) so the existing CRUD tests actually run.

Steps to reproduce: pytest tests/unit/test_review_service.py -q — observed: 13 failed, 6 passed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestsTest coveragetier-1Starter difficulty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions