[Zope-CVS] CVS: Packages/TestScripts - autotester.py:1.25

Fred L. Drake, Jr. fred@zope.com
Fri, 7 Mar 2003 13:37:29 -0500


Update of /cvs-repository/Packages/TestScripts
In directory cvs.zope.org:/tmp/cvs-serv29463

Modified Files:
	autotester.py 
Log Message:
cosmetic changes:
- make the message separator the same width as the separator used by
  the unit tests
- only print the separator once if there are no messages
- don't print extra periods when removing an old sandbox


=== Packages/TestScripts/autotester.py 1.24 => 1.25 ===
--- Packages/TestScripts/autotester.py:1.24	Wed Feb 26 17:07:44 2003
+++ Packages/TestScripts/autotester.py	Fri Mar  7 13:37:24 2003
@@ -92,13 +92,15 @@
 other_errors_re = re.compile('error|warning', re.IGNORECASE)
 success_re = re.compile('^OK$', re.MULTILINE)
 
+SEPARATOR = '='*70 + '\n'
+
 try: # catch-all for death and badness
   for scenario in config['scenario']:
     os.chdir(home)
 
     # blow away the sandbox
     if os.path.isdir(sandbox):
-        note("Removing existing sandbox...")
+        note("Removing existing sandbox.")
         shutil.rmtree(sandbox)
     os.makedirs(sandbox)
 
@@ -152,11 +154,12 @@
     address = scenario['email'][0]()
     body = StringIO.StringIO()
 
-    linewidth=78
-    body.write('='*linewidth+'\n')
-    for message in scenario.get('message',()):
-        body.write(message().strip()+'\n')
-    body.write('='*linewidth+'\n')
+    body.write(SEPARATOR)
+    messages = scenario.get('message',())
+    if messages:
+        for message in messages:
+            body.write(message().strip()+'\n')
+        body.write(SEPARATOR)
     body.write('Python Version:%s\n' % python_version.strip())
     body.write('\n')
     body.write('Modules included:\n')