Skip to content

test(orm): remove FakeSeeder test double, assert via autospec mock - #176

Merged
tmgbedu merged 1 commit into
experimentsfrom
task/fakeseeder-cleanup-1004
Jul 14, 2026
Merged

test(orm): remove FakeSeeder test double, assert via autospec mock#176
tmgbedu merged 1 commit into
experimentsfrom
task/fakeseeder-cleanup-1004

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the hand-rolled FakeSeeder test double from test_db_seed_command.py on experiments
  • Replaces it with mock.patch("fastapi_startkit.masoniteorm.seeders.Seeder", autospec=True), asserting constructor args and awaited calls directly (assert_called_once_with, assert_awaited_once_with)
  • Mirrors the same cleanup already applied on the PR Add test coverage for masoniteorm make and seed console commands #155 branch (commit 8471bd9), adapted to the post seeds->seeders rename module path (masoniteorm.seeders)
  • Output assertions kept only for the user-facing message contract; exception-path tests still use assertRaises via CommandTester._run

Test plan

  • grep -rn FakeSeeder . returns nothing
  • uv run pytest tests/masoniteorm/commands/ -v — 41 passed, 1 skipped
  • uv run pytest --ignore=tests/masoniteorm/postgres — 1837 passed, 7 skipped (no regressions)
  • uv run ruff check . and uv run ruff format --check . — clean

🤖 Generated with Claude Code

Replace the hand-rolled FakeSeeder class in test_db_seed_command.py
with mock.patch(..., autospec=True) against the real Seeder, asserting
constructor args and awaited calls directly. Same cleanup already
applied on the PR #155 branch (commit 8471bd9) but missed on the
experiments seeds->seeders refactor (PR #175).
@tmgbedu
tmgbedu merged commit 79c1ba9 into experiments Jul 14, 2026
5 checks passed
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant