mirror of
https://github.com/python/cpython.git
synced 2025-08-11 04:19:06 +00:00
[3.12] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126756)
(cherry picked from commit dff074d144
)
This commit is contained in:
parent
04f38bb775
commit
ad4f8debda
7 changed files with 114 additions and 58 deletions
|
@ -15,7 +15,7 @@ import unittest
|
|||
from io import StringIO
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
|
||||
from test.support.i18n_helper import TestTranslationsBase, update_translation_snapshots
|
||||
|
||||
import optparse
|
||||
from optparse import make_option, Option, \
|
||||
|
@ -1656,5 +1656,14 @@ class MiscTestCase(unittest.TestCase):
|
|||
support.check__all__(self, optparse, not_exported=not_exported)
|
||||
|
||||
|
||||
class TestTranslations(TestTranslationsBase):
|
||||
def test_translations(self):
|
||||
self.assertMsgidsEqual(optparse)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# To regenerate translation snapshots
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '--snapshot-update':
|
||||
update_translation_snapshots(optparse)
|
||||
sys.exit(0)
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue