[GRASS-SVN] r73943 - grass/branches/releasebranch_7_6/scripts/g.search.modules/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jan 16 05:14:20 PST 2019


Author: neteler
Date: 2019-01-16 05:14:20 -0800 (Wed, 16 Jan 2019)
New Revision: 73943

Modified:
   grass/branches/releasebranch_7_6/scripts/g.search.modules/testsuite/test_g_search_modules.py
Log:
g.search.modules/testsuite: fix import termcolor error

Modified: grass/branches/releasebranch_7_6/scripts/g.search.modules/testsuite/test_g_search_modules.py
===================================================================
--- grass/branches/releasebranch_7_6/scripts/g.search.modules/testsuite/test_g_search_modules.py	2019-01-15 09:57:42 UTC (rev 73942)
+++ grass/branches/releasebranch_7_6/scripts/g.search.modules/testsuite/test_g_search_modules.py	2019-01-16 13:14:20 UTC (rev 73943)
@@ -5,7 +5,7 @@
 
 PURPOSE:   Test g.search.modules script outputs
 
-COPYRIGHT: (C) 2015 Jachym Ceppicky, and by the GRASS Development Team
+COPYRIGHT: (C) 2015 Jachym Cepicky, and by the GRASS Development Team
 
            This program is free software under the GNU General Public
            License (>=v2). Read the file COPYING that comes with GRASS
@@ -16,9 +16,15 @@
 from grass.gunittest.main import test
 from grass.gunittest.gmodules import SimpleModule
 
-import termcolor
+import unittest
 
+try:
+    has_termcolor = True
+    import termcolor
+except ImportError:
+    has_termcolor = False
 
+
 class TestSearchModule(TestCase):
 
     def test_terminal_output(self):
@@ -44,6 +50,8 @@
         self.assertEqual(len(stdout), 6)
         self.assertEqual(stdout[3], 'r.water.outlet')
 
+    @unittest.skipUnless(has_termcolor,
+                         "not supported in this library version")
     def test_colored_terminal(self):
         module = SimpleModule('g.search.modules', keyword="water", flags="c")
         self.assertModule(module)



More information about the grass-commit mailing list