Skip to content

test: cover remaining uncovered branches in i18n and number - #492

Closed
denbotanin-source wants to merge 2 commits into
python-humanize:mainfrom
denbotanin-source:add-tests-i18n-number-coverage
Closed

denbotanin-source wants to merge 2 commits into
python-humanize:mainfrom
denbotanin-source:add-tests-i18n-number-coverage

Conversation

@denbotanin-source

Copy link
Copy Markdown

Что сделано

  • Добавлены unit-тесты для ранее непокрытых веток в i18n.py и number.py.
  • Покрытие проекта: 99% → 100% (561 statements, 0 missed).
  • Все тесты проходят: 733 passed, 134 skipped.

Покрытые участки

Файл Строки Что покрыто
src/humanize/i18n.py 92–94 кэширование перевода при первом activate() (cache-miss)
src/humanize/number.py 90 fallback _format_not_finite() для конечных значений
src/humanize/number.py 202 intcomma с кастомными thousands/decimal разделителями
src/humanize/number.py 530, 534 clamp(): ValueError при невалидном format

Тип изменений

  • Только тесты (без изменений в исходном коде)

Чек-лист

  • Все существующие тесты проходят
  • Новые тесты в стиле проекта (monkeypatch, pytest.raises)
  • pytest --cov=humanize → 100%

@hugovk

hugovk commented Nov 12, 2026

Copy link
Copy Markdown
Member

Closing, see #512.

@hugovk hugovk closed this Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6b817b9) to head (7b10427).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #492      +/-   ##
===========================================
+ Coverage   99.70%   100.00%   +0.29%     
===========================================
  Files          12        12              
  Lines        1020      1045      +25     
===========================================
+ Hits         1017      1045      +28     
+ Misses          3         0       -3     
Flag Coverage Δ
macos-latest 97.60% <100.00%> (+0.35%) ⬆️
ubuntu-latest 97.60% <100.00%> (+0.35%) ⬆️
windows-latest 93.20% <100.00%> (+0.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants