[GRASS-SVN] r61412 - grass/trunk/lib/python/gunittest

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 25 14:59:44 PDT 2014


Author: wenzeslaus
Date: 2014-07-25 14:59:43 -0700 (Fri, 25 Jul 2014)
New Revision: 61412

Modified:
   grass/trunk/lib/python/gunittest/main.py
   grass/trunk/lib/python/gunittest/reporters.py
Log:
gunittest: remove Python coverage (needs settings and test types to work properly)

Modified: grass/trunk/lib/python/gunittest/main.py
===================================================================
--- grass/trunk/lib/python/gunittest/main.py	2014-07-25 21:51:44 UTC (rev 61411)
+++ grass/trunk/lib/python/gunittest/main.py	2014-07-25 21:59:43 UTC (rev 61412)
@@ -77,14 +77,16 @@
     # TODO: we probably need to have different test  functions for C, Python modules, and Python code
     # TODO: combine the results using python -m coverage --help | grep combine
     # TODO: function to anonymize/beautify file names (in content and actual filenames)
-    doing_coverage = False
-    try:
-        import coverage
-        doing_coverage = True
-        cov = coverage.coverage(omit="*testsuite*")
-        cov.start()
-    except ImportError:
-        pass
+    # TODO: implement coverage but only when requested by invoker and only if
+    # it makes sense for tests (need to know what is tested)
+    # doing_coverage = False
+    #try:
+    #    import coverage
+    #    doing_coverage = True
+    #    cov = coverage.coverage(omit="*testsuite*")
+    #    cov.start()
+    #except ImportError:
+    #    pass
         # TODO: add some message somewhere
 
     # TODO: enable passing omit to exclude also gunittest or nothing
@@ -92,9 +94,9 @@
     # TODO: check if we are in the directory where the test file is
     # this will ensure that data directory is available when it is requested
 
-    if doing_coverage:
-        cov.stop()
-        cov.html_report(directory='testcodecoverage')
+    #if doing_coverage:
+    #    cov.stop()
+    #    cov.html_report(directory='testcodecoverage')
 
     # TODO: is sys.exit the right thing here
     sys.exit(not program.result.wasSuccessful())
@@ -113,22 +115,9 @@
     Runs using::
         python main.py discovery [start_directory]
     """
-    doing_coverage = False
-    try:
-        import coverage
-        doing_coverage = True
-        cov = coverage.coverage(omit="*testsuite*")
-        cov.start()
-    except ImportError:
-        pass
-        # TODO: add some message somewhere
 
     program = GrassTestProgram(grass_location='nc', exit_at_end=False)
 
-    if doing_coverage:
-        cov.stop()
-        cov.html_report(directory='testcodecoverage')
-
     sys.exit(not program.result.wasSuccessful())
 
 

Modified: grass/trunk/lib/python/gunittest/reporters.py
===================================================================
--- grass/trunk/lib/python/gunittest/reporters.py	2014-07-25 21:51:44 UTC (rev 61411)
+++ grass/trunk/lib/python/gunittest/reporters.py	2014-07-25 21:59:43 UTC (rev 61412)
@@ -601,12 +601,13 @@
                     ', '.join(modules)))
         file_index.write('<tbody><table>')
 
+        # here we would have also links to coverage, profiling, ...
+        #'<li><a href="testcodecoverage/index.html">code coverage</a></li>'
         files_section = (
             '<h3>Supplementary files</h3>'
             '<ul>'
             '<li><a href="stdout.html">standard output (stdout)</a></li>'
             '<li><a href="stderr.html">standard error output (stderr)</a></li>'
-            '<li><a href="testcodecoverage/index.html">code coverage</a></li>'
             )
         file_index.write(files_section)
 



More information about the grass-commit mailing list