-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-130655: add tests for dgettext #134594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |||||
|
|
||||||
|
|
||||||
| # TODO: | ||||||
| # - Add new tests, for example for "dgettext" | ||||||
| # - Tests should have only one assert. | ||||||
|
|
||||||
| GNU_MO_DATA = b'''\ | ||||||
|
|
@@ -937,6 +936,50 @@ def test_lazy_import(self): | |||||
| ensure_lazy_imports("gettext", {"re", "warnings", "locale"}) | ||||||
|
|
||||||
|
|
||||||
| class DGettextTest(GettextBaseTest): | ||||||
|
|
||||||
| def setUp(self): | ||||||
| GettextBaseTest.setUp(self) | ||||||
|
||||||
| GettextBaseTest.setUp(self) | |
| super().setUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to tearDown this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reset_gettext() resets the state from GettextBaseTest is enough
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Join this one with the other two, these all test the exact same thing (which is well tested above too).
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just store the expected, it is clearer. And this part is made simpler.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need these these anyway, it's long and pretty much identical to the previous two. dgettext is a pretty simple wrapper. Maybe merge the first two test_dgettext_translation for organization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the TODO, since it is still valid (the first part).
It can be updated with the issue number if you wish.