]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-130197: Test pygettext --output option (GH-133041) (GH-133266)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 9 May 2025 07:56:58 +0000 (09:56 +0200)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 07:56:58 +0000 (07:56 +0000)
(cherry picked from commit e5e51bd7f72639be6548c806cc14ea53995bf1b3)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Lib/test/test_tools/test_i18n.py

index ffa1b1178eddbc9d757e1539d6d88d636cfc5a50..0666f999b4320727ee21c34238558a8f6cc7ff7a 100644 (file)
@@ -149,6 +149,14 @@ class Test_pygettext(unittest.TestCase):
             # This will raise if the date format does not exactly match.
             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):
         for doc in ('"""doc"""', "r'''doc'''", "R'doc'", 'u"doc"'):
             with self.subTest(doc):