Fix broken test suite and swallowed 404 in market symbol-info route - #48
Closed
michaelcybermak wants to merge 1 commit into
Closed
Fix broken test suite and swallowed 404 in market symbol-info route#48michaelcybermak wants to merge 1 commit into
michaelcybermak wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
init()with a 3-arg lambda whilemain.pycalls it with 4 (login, password, server, path), causingTypeErroron every route testmarket/ordersroute tests patched a nonexistent module-levelclientpath instead ofapp.state.client, and several tests hit wrong URLs (/accounts,/ordersinstead of/account,/order) or asserted kwargs/messages that don't match the actual client/pydantic v2 APIrouters/market.py: the 404 raised for an unknown symbol was being caught by the same handler's own broadexcept Exceptionand turned into a 500Test plan
pytest tests/— 14 passed, 39 skipped (MT5-connection tests requiring a live terminal)🤖 Generated with Claude Code