| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add comprehensive test coverage for the domain-specific gettext functions that were previously untested. This addresses the TODO comment in test_gettext.py that explicitly requested tests for these functions. Changes: - Remove TODO comment requesting dgettext tests - Add DGettextTests class with 7 tests for dgettext() - Add DnGettextTests class with 7 tests for dngettext() - Add DpGettextTests class with 6 tests for dpgettext() - Add DnpGettextTests class with 7 tests for dnpgettext() Each test covers: - Basic translation functionality - Fallback behavior for missing domains - Behavior when translations are missing - Edge cases (wrong context, large numbers, special characters)
|
The following commit authors need to sign the Contributor License Agreement: |
Sorry, something went wrong.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead. |
Sorry, something went wrong.
|
Closing as this is a duplicate of #134594 (dgettext tests) and #148430 (which covered dgettext, dpgettext, dngettext, and dnpgettext). Thank you for the review feedback from @StanFromIreland. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This PR adds comprehensive test coverage for the domain-specific gettext functions (dgettext, dngettext, dpgettext, dnpgettext) that were previously untested. This addresses an explicit TODO comment in test_gettext.py that requested tests for these functions.
Changes
Test Coverage
Each test class covers:
Motivation
The gettext module provides both non-domain-specific functions (gettext, ngettext, pgettext, npgettext) and domain-specific functions (dgettext, dngettext, dpgettext, dnpgettext). While the non-domain functions had test coverage, the domain-specific functions were only tested indirectly through the PluralFormsTests mixin. This PR adds direct, focused tests for each domain-specific function.
The existing TODO comment in the file explicitly requested:
This contribution follows the coding style of the existing tests and uses the same test fixtures (GNU_MO_DATA) that are already defined in the file.