]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-130197: Test pygettext --output option (GH-133041)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Thu, 1 May 2025 16:30:24 +0000 (17:30 +0100)
committerGitHub <noreply@github.com>
Thu, 1 May 2025 16:30:24 +0000 (19:30 +0300)
Lib/test/test_tools/test_i18n.py

index 8416b1bad825eb567bf9114d47487536f5d76f10..d1831d68f0281d95841c2c33f03ddd5f0e841083 100644 (file)
@@ -162,6 +162,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):