1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Description: Allow tests of command-line tools to be skipped
The test suite has no clean separation between testing the command line tools
and testing the classes; the packaging will end up separating them, making
in-place testing of only the modules difficult. This patch adds an environment
variable to disable command-line tools being called from tests.
Author: Stuart Prescott <stuart@debian.org>
--- a/tests/xliff_conformance/test_xliff_conformance.py
+++ b/tests/xliff_conformance/test_xliff_conformance.py
@@ -24,6 +24,7 @@
from lxml import etree
+import pytest
schema = None
@@ -47,6 +48,8 @@
yield fullpath
+@pytest.mark.skipif('TTKIT_SKIP_COMMANDS' in os.environ,
+ reason='Skip testing command line tools')
def test_open_office_to_xliff():
assert call(['oo2xliff', 'en-US.sdf', '-l', 'fr', 'fr']) == 0
for filepath in find_files('fr', '.xlf'):
@@ -54,6 +57,8 @@
cleardir('fr')
+@pytest.mark.skipif('TTKIT_SKIP_COMMANDS' in os.environ,
+ reason='Skip testing command line tools')
def test_po_to_xliff():
OUTPUT = 'af-pootle.xlf'
assert call(['po2xliff', 'af-pootle.po', OUTPUT]) == 0
--- a/translate/storage/test_mo.py
+++ b/translate/storage/test_mo.py
@@ -5,6 +5,7 @@
from translate.storage import factory, mo, test_base
+import pytest
class TestMOUnit(test_base.TestTranslationUnit):
UnitClass = mo.mounit
@@ -137,6 +138,8 @@
store.addunit(unit)
assert b'context' in store.__bytes__()
+ @pytest.mark.skipif('TTKIT_SKIP_COMMANDS' in os.environ,
+ reason='Skip testing command line tools')
def test_output(self):
for posource in posources:
print("PO source file")
|