TICKET-034: Add test for alloc.__main__ module entry point
What's Wrong
alloc/__main__.py has zero test coverage. This module enables python -m alloc invocation and delegates to alloc.cli.main(). If the delegation breaks (import error, wrong function reference, exit code mismatch), the module entry point silently fails for users.
Evidence
alloc/__main__.py lines 1–17: delegates to alloc.cli.main()
grep -rn "__main__\|python -m alloc" tests/ → no matches
tests/test_cli.py exists but only tests alloc.cli directly, not the __main__ delegation path
- The
if __name__ == "__main__" guard on line 16 is never exercised by any test
Impact
- Users running
python -m alloc could encounter uncaught import errors or wrong exit codes with no test safety net
- The
__main__ module is the documented entry point in README.md ("python -m alloc.core --backtest") — if it breaks, the quick-start guide is broken
- Minor risk but high visibility: this is the first thing a new user tries
Suggestion
Add to tests/test_cli.py (or a new tests/test_main.py):
TICKET-034: Add test for
alloc.__main__module entry pointWhat's Wrong
alloc/__main__.pyhas zero test coverage. This module enablespython -m allocinvocation and delegates toalloc.cli.main(). If the delegation breaks (import error, wrong function reference, exit code mismatch), the module entry point silently fails for users.Evidence
alloc/__main__.pylines 1–17: delegates toalloc.cli.main()grep -rn "__main__\|python -m alloc" tests/→ no matchestests/test_cli.pyexists but only testsalloc.clidirectly, not the__main__delegation pathif __name__ == "__main__"guard on line 16 is never exercised by any testImpact
python -m alloccould encounter uncaught import errors or wrong exit codes with no test safety net__main__module is the documented entry point inREADME.md("python -m alloc.core --backtest") — if it breaks, the quick-start guide is brokenSuggestion
Add to
tests/test_cli.py(or a newtests/test_main.py):