mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
[3.13] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126755)
(cherry picked from commit dff074d144
)
This commit is contained in:
parent
cb07c44e19
commit
1c158705f1
7 changed files with 114 additions and 57 deletions
|
@ -1,11 +1,12 @@
|
|||
# test_getopt.py
|
||||
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
|
||||
|
||||
from test.support.os_helper import EnvironmentVarGuard
|
||||
import doctest
|
||||
import unittest
|
||||
|
||||
import getopt
|
||||
import sys
|
||||
import unittest
|
||||
from test.support.i18n_helper import TestTranslationsBase, update_translation_snapshots
|
||||
from test.support.os_helper import EnvironmentVarGuard
|
||||
|
||||
sentinel = object()
|
||||
|
||||
|
@ -173,10 +174,20 @@ def test_libref_examples():
|
|||
['a1', 'a2']
|
||||
"""
|
||||
|
||||
|
||||
class TestTranslations(TestTranslationsBase):
|
||||
def test_translations(self):
|
||||
self.assertMsgidsEqual(getopt)
|
||||
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests.addTest(doctest.DocTestSuite())
|
||||
return tests
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if __name__ == '__main__':
|
||||
# To regenerate translation snapshots
|
||||
if len(sys.argv) > 1 and sys.argv[1] == '--snapshot-update':
|
||||
update_translation_snapshots(getopt)
|
||||
sys.exit(0)
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue