Skip to content

refactor(tests): split oversized modules and consolidate mocks - #408

Merged
spalen0 merged 2 commits into
mainfrom
cleanup
Oct 3, 2026
Merged

spalen0 merged 2 commits into
mainfrom
cleanup

Conversation

@spalen0

@spalen0 spalen0 commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

The 2,411-line explainer test module mixed prompt construction, output parsing, address handling, transaction flows, state reads, and batch execution. Split it into six focused modules under tests/ai_explainer/, and extract Telegram, alert, dispatch, and Web3 tests from test_utils.py into dedicated files.

Consolidate repeated LLM provider and HTTP response mocks, share address-test setup, and correct the missing-Telegram-credentials test to assert that no POST request is sent. Preserve every existing test case and its assertions, with that intentional correction. Shared builders have public names, and response mocks explicitly configure raise_for_status. The cleanup removes 75 lines overall.

Validation:

  • Full suite: 1,691 passed, 4 skipped, 48 subtests passed.
  • Review follow-up: all 143 explainer and Telegram tests passed, with 5 subtests passed.
  • All 193 moved test methods and their assertions compared against the originals.
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run ty check
  • git diff --check

@spalen0
spalen0 merged commit 4b32100 into main Oct 3, 2026
3 checks passed
@spalen0
spalen0 deleted the cleanup branch October 3, 2026 07:42
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