mailr12131 - /1.3/test_suite/test_suite_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 04, 2011 - 12:34:
Author: bugman
Date: Tue Jan  4 12:34:21 2011
New Revision: 12131

URL: http://svn.gna.org/viewcvs/relax?rev=12131&view=rev
Log:
Modified the test suite printout to use the formatting subtitle() and title() 
functions.


Modified:
    1.3/test_suite/test_suite_runner.py

Modified: 1.3/test_suite/test_suite_runner.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/test_suite_runner.py?rev=12131&r1=12130&r2=12131&view=diff
==============================================================================
--- 1.3/test_suite/test_suite_runner.py (original)
+++ 1.3/test_suite/test_suite_runner.py Tue Jan  4 12:34:21 2011
@@ -25,7 +25,7 @@
 import sys
 
 # Formatting.
-from formatting import heading, summary_line
+from formatting import subtitle, summary_line, title
 
 # Import the test suite categories.
 from system_tests import System_test_runner
@@ -79,7 +79,7 @@
         """Function for executing the system/functional tests."""
 
         # Print a header.
-        heading('System / functional tests')
+        title('System / functional tests')
 
         # Run the tests.
         system_runner = System_test_runner()
@@ -93,7 +93,7 @@
         """Function for executing the unit tests."""
 
         # Print a header.
-        heading('Unit tests')
+        title('Unit tests')
 
         # Run the tests.
         unit_runner = 
Unit_test_runner(root_path=status.install_path+os.sep+'test_suite'+os.sep+'unit_tests')
@@ -106,17 +106,14 @@
     def summary(self):
         """Print out a summary of the relax test suite."""
 
-        # Heading.
-        print("\n\n\n")
-        print("###################################")
-        print("# Summary of the relax test suite #")
-        print("###################################\n")
+        # Title.
+        title("Summary of the relax test suite")
 
         # The skipped tests.
         self.summary_skipped()
 
-        # Title.
-        print("\nSynopsis:\n")
+        # Subtitle.
+        subtitle("Synopsis")
 
         # System/functional test summary.
         if hasattr(self, 'system_result'):
@@ -161,11 +158,22 @@
         missing_modules = system_count.keys()
         missing_modules.sort()
 
+        # Sub-title.
+        subtitle("Optional modules")
+
+        # Nothing missing.
+        if not missing_modules:
+            # Print out.
+            print("No tests skipped due to missing modules.\n")
+
+            # The skip the table.
+            return
+
         # The formatting string.
         format = "%-30s %20s %20s"
 
         # Header.
-        print("\nTests skipped due to missing optional modules:\n")
+        print("\nCount of tests skipped due to missing modules:\n")
         header = format % ("Module", "System tests", "Unit tests")
         print('-'*len(header))
         print(header)
@@ -177,4 +185,4 @@
 
         # End the table.
         print('-'*len(header))
-        print("\n\n")
+        print("\n")




Related Messages


Powered by MHonArc, Updated Tue Jan 04 12:40:02 2011