[Zope-CVS] CVS: Packages/FunctionalTests/FunctionalTests - Framework.py:1.3.4.1

Karl Anderson cvs-admin at zope.org
Thu Nov 13 13:12:29 EST 2003


Update of /cvs-repository/Packages/FunctionalTests/FunctionalTests
In directory cvs.zope.org:/tmp/cvs-serv6191

Modified Files:
      Tag: kra-intersest-branch
	Framework.py 
Log Message:

buildTest(): don't load/buildTest for suite subfiles here, let the suite do it.

Suite._execute(): load the scenario/suite files and buildTest for the child
scenarios here, then execute.  Keep returned Result for next scenario.

This is so a test can change the ConfigParser defaults.


=== Packages/FunctionalTests/FunctionalTests/Framework.py 1.3 => 1.3.4.1 ===
--- Packages/FunctionalTests/FunctionalTests/Framework.py:1.3	Tue May 20 21:05:05 2003
+++ Packages/FunctionalTests/FunctionalTests/Framework.py	Thu Nov 13 13:12:29 2003
@@ -231,15 +231,19 @@
 
     def addChild( self, child, repeat_count=1 ):
         """
+           Add a child tuple to be loaded and executed later.
         """
         for i in range( repeat_count ):
             self._children.append( child )
 
     def _execute( self, result ):
-
-        for child in self.listChildren():
+        """
+           Load and execute each child scenario/suite file.
+        """
+        for file, defaults in self.listChildren():
+            child = buildTest( file, defaults )
             childResult = result.newChild( child )
-            child( childResult )
+            result = child( childResult )
 
 SECTION_HEADER = re.compile( r'\[([A-Za-z][A-Za-z0-9_]*)\]')
 
@@ -306,7 +310,7 @@
         if isScenario:
             test.addRequest( buildRequest( cp, section ), repeat_count )
         else:
-            child = buildTest( cp.get( section, 'file' ), defaults )
+            child = ( cp.get( section, 'file' ), defaults )
             test.addChild( child, repeat_count )
 
     if isScenario and _POSTCONDITION_SECTION in cp.listSpecialSections( 0 ):




More information about the Zope-CVS mailing list