Stabilize neo grandfather source tests on Windows#7778
Conversation
Greptile SummaryAdds
Confidence Score: 5/5Safe to merge — the change is a one-line encoding fix per call site with no logic impact. All three open() calls that read Python source files as text now specify encoding='utf-8', which is the only change. Assertions are untouched and test coverage is unaffected. The fix is narrowly scoped to a real Windows locale bug and introduces no new risk. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant pytest
participant test_neo_desktop_grandfather.py
participant routers/payment.py
participant utils/subscription.py
pytest->>test_neo_desktop_grandfather.py: run tests
test_neo_desktop_grandfather.py->>routers/payment.py: "open(encoding='utf-8')"
routers/payment.py-->>test_neo_desktop_grandfather.py: source text (UTF-8)
test_neo_desktop_grandfather.py->>test_neo_desktop_grandfather.py: assert current_period_start present x2
test_neo_desktop_grandfather.py->>utils/subscription.py: "open(encoding='utf-8')"
utils/subscription.py-->>test_neo_desktop_grandfather.py: source text (UTF-8)
test_neo_desktop_grandfather.py->>test_neo_desktop_grandfather.py: assert reconcile + env-override strings present
test_neo_desktop_grandfather.py-->>pytest: 19 passed
Reviews (1): Last reviewed commit: "Stabilize neo grandfather source tests o..." | Re-trigger Greptile |
Summary
routers/payment.pyandutils/subscription.pyas UTF-8 intest_neo_desktop_grandfather.pyWindows reproduction
Before this change on Windows with the default GBK locale:
python -m pytest tests\unit\test_neo_desktop_grandfather.py -q-> 3 failed, 16 passed, 1 warningUnicodeDecodeError: 'gbk' codec can't decode byte ...while readingrouters/payment.pyandutils/subscription.pyTesting
python -m pytest tests\unit\test_neo_desktop_grandfather.py -q-> 19 passed, 1 warningpython -m black --line-length 120 --skip-string-normalization tests\unit\test_neo_desktop_grandfather.py --checkpython -m py_compile tests\unit\test_neo_desktop_grandfather.pygit diff --check