Sven Geboers
|
a3154f72df
|
refactor: extract shared helpers to common.py, fix bugs, add TDD tests
- Created analysis/right_wing/common.py with all shared helpers:
Constants: CANONICAL_CENTRIST, COALITION, BREAK_YEAR, etc.
Functions: _conn, cohens_d, build_party_name_map, parse_lead_submitter,
motion_passed, quarter_sort_key, find_inflection_point
- Fixed bugs:
1. ai_provider.py: requests.Timeout now caught alongside ConnectionError
2. voting_margin.py: Removed walrus operator misuse, fixed Mann-Whitney test
- Updated 13 consuming files to import from common.py
- Added 35 TDD tests in tests/right_wing/test_common.py
- 282 tests pass (was 247)
|
3 weeks ago |