test: cover 5 low-coverage modules (closes ROADMAP L2578 executor → all repos ≥80%)#172
Merged
Merged
Conversation
… executor) Coverage 76.30% → 80.03% (target 80%). Suite 684 → 755 (+71 tests). New test modules: - tests/test_config_loader.py ( 5 tests, 100% module cov) - tests/test_price_monitor.py (21 tests, 100% module cov) - tests/test_bracket_orders.py ( 8 tests, 98% module cov; 1 unreachable else branch) - tests/test_emergency_shutdown.py (12 tests, 97% module cov) - tests/test_trade_logger.py (23 tests, 100% module cov) All new tests use mocked IBKRClient / boto3 / subprocess / urllib — no IB Gateway, no S3, no real AWS credentials required. Trade-logger tests use tmp_path sqlite for isolation. `liquidate_all.py` skipped: bare imports (`from ibkr import ...`) only resolve when run as a script from the executor/ directory, not as a package module. Would need a refactor before unit-testable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Coverage delta
executor/config_loader.pyexecutor/price_monitor.pyexecutor/bracket_orders.pyexecutor/emergency_shutdown.pyexecutor/trade_logger.pyROADMAP L2578 status after this PR
All 6 repos at or above the 80% target:
Notes
executor/liquidate_all.pywas excluded. It uses bare imports (from ibkr import IBKRClient,from trade_logger import ...) that only resolve when the file is run as a script from theexecutor/directory;import executor.liquidate_allfails withModuleNotFoundError. Would require a small refactor to package-qualified imports before becoming unit-testable. Not in scope for this coverage push.executor/bracket_orders.py:117is an unreachableelsebranch (the upstreamterminal_statesset already covers every value the priorelifchecks against). Pinned at 98% rather than 100%.Test plan
pytest -q— 755 passedpytest --cov=. --cov-report=term-missing— overall 80.03%requirements.txt🤖 Generated with Claude Code