Skip to content

Fix broken test suite and swallowed 404 in market symbol-info route - #48

Closed
michaelcybermak wants to merge 1 commit into
ariadng:mainfrom
michaelcybermak:main
Closed

Fix broken test suite and swallowed 404 in market symbol-info route#48
michaelcybermak wants to merge 1 commit into
ariadng:mainfrom
michaelcybermak:main

Conversation

@michaelcybermak

Copy link
Copy Markdown

Summary

  • Test fixtures stubbed the lifespan's init() with a 3-arg lambda while main.py calls it with 4 (login, password, server, path), causing TypeError on every route test
  • market/orders route tests patched a nonexistent module-level client path instead of app.state.client, and several tests hit wrong URLs (/accounts, /orders instead of /account, /order) or asserted kwargs/messages that don't match the actual client/pydantic v2 API
  • Fixes a real bug in routers/market.py: the 404 raised for an unknown symbol was being caught by the same handler's own broad except Exception and turned into a 500

Test plan

  • pytest tests/ — 14 passed, 39 skipped (MT5-connection tests requiring a live terminal)

🤖 Generated with Claude Code

Test fixtures stubbed the lifespan's init() with a 3-arg lambda while
main.py calls it with 4 (login, password, server, path), causing
TypeError on every route test. market/orders route tests also patched
a nonexistent module-level client path instead of app.state.client,
and several tests hit wrong URLs (/accounts, /orders) or asserted
kwargs/messages that don't match the actual client/pydantic v2 API.

Also fixes a real bug in routers/market.py: the 404 raised for an
unknown symbol was being caught by the same handler's own broad
except Exception and turned into a 500.
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