mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-03 20:34:43 +00:00
Output msgfmt error on test_pos failure
This commit is contained in:
parent
ae577357ed
commit
b4c2599aef
1 changed files with 5 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ Test gettext .po files.
|
|||
"""
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import subprocess
|
||||
import glob
|
||||
from tests import need_msgfmt, need_posix
|
||||
|
||||
|
|
@ -47,8 +47,10 @@ class TestPo(unittest.TestCase):
|
|||
def test_pos(self):
|
||||
"""Test .po files syntax."""
|
||||
for f in get_pofiles():
|
||||
ret = os.system("msgfmt -c -o - %s > /dev/null" % f)
|
||||
self.assertEqual(ret, 0, msg="PO-file syntax error in %r" % f)
|
||||
cp = subprocess.run(["msgfmt", "-c", "-o", "-", f], capture_output=True)
|
||||
self.assertEqual(
|
||||
cp.returncode, 0,
|
||||
msg=f"PO-file syntax error in {f!r}: {str(cp.stderr, 'utf-8')}")
|
||||
|
||||
|
||||
class TestGTranslator(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue