[3.13] gh-130197: Test pygettext --output option (GH-133041) (GH-133266)

(cherry picked from commit e5e51bd7f7)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-05-09 09:56:58 +02:00 committed by GitHub
parent 4c7a04b8bd
commit d14a1b7a0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -149,6 +149,14 @@ def test_POT_Creation_Date(self):
# This will raise if the date format does not exactly match. # This will raise if the date format does not exactly match.
datetime.strptime(creationDate, '%Y-%m-%d %H:%M%z') datetime.strptime(creationDate, '%Y-%m-%d %H:%M%z')
def test_output_option(self):
for opt in ('-o', '--output='):
with temp_cwd():
assert_python_ok(self.script, f'{opt}test')
self.assertTrue(os.path.exists('test'))
res = assert_python_ok(self.script, f'{opt}-')
self.assertIn(b'Project-Id-Version: PACKAGE VERSION', res.out)
def test_funcdocstring(self): def test_funcdocstring(self):
for doc in ('"""doc"""', "r'''doc'''", "R'doc'", 'u"doc"'): for doc in ('"""doc"""', "r'''doc'''", "R'doc'", 'u"doc"'):
with self.subTest(doc): with self.subTest(doc):