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

Chris Withers chrisw@nipltd.com
Tue, 30 Jul 2002 08:12:26 -0400


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

Modified Files:
	autotester.py 
Log Message:
Send seperate maisl wih even mroe meaningful subject lines.

=== Packages/TestScripts/autotester.py 1.13 => 1.14 ===
 smtp_server=email['smtp'][0]()
 from_address=email['from'][0]()
 
-# The emails to send (email address->StringIO object)
-emails={}
+
+# The emails to send ( list of (email address,StringIO object,scenario name))
+emails=[]
 
 # executor
 def execute(location,python,command,options):
@@ -74,7 +75,7 @@
   for scenario in config['scenario']:
 
     # blow away the sandbox
-    chdir(home)
+    chdir(home)    
     # the sandbox MUST now exist before this runs for the first time...
     rmtree(sandbox)
 
@@ -136,10 +137,7 @@
     
     # write the results to the appropriate StringIO
     address = scenario['email'][0]()
-    body = emails.get(address)
-    if body is None:
-        body = StringIO()
-        emails[address]=body
+    body = StringIO()
         
     linewidth=78
     body.write('='*linewidth+'\n')
@@ -155,10 +153,12 @@
     body.write(test_result.strip())
     body.write('\n')
 
+    emails.append((address,body,scenario().strip()))
+
   # send the mail
   failed_re = compile('FAILED \(failures=(\d+)(?:, errors=(\d+))?')
-  for address,body in emails.items():    
-    subject = email['subject'][0]()
+  for address,body,name in emails:    
+    subject = email['subject'][0]()+ ' - ' + name + ' - '
     content = body.getvalue()
 
     failures = 0