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
 
 # get directory of this test
 dir = os.path.dirname(os.path.abspath(__file__))
@@ -60,6 +61,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'):
@@ -67,6 +70,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
 
 # get directory of this test
 dir = os.path.dirname(os.path.abspath(__file__))
@@ -136,6 +137,8 @@
         store.updateheader(add=True, Language="zu")
         assert store.gettargetlanguage() == "zu"
 
+    @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")
