[Zope-Checkins] CVS: Zope2 - testrunner.py:1.6.2.2

Brian Lloyd brian@digicool.com
Fri, 30 Mar 2001 11:02:44 -0500 (EST)


Update of /cvs-repository/Zope2/utilities
In directory korak:/home/brian/temp/zope-23-branch/utilities

Modified Files:
      Tag: zope-2_3-branch
	testrunner.py 
Log Message:
Added trickery to cd to test directories before running to make 
relative sample data paths work



--- Updated File testrunner.py in package Zope2 --
--- testrunner.py	2001/03/01 15:27:36	1.6.2.1
+++ testrunner.py	2001/03/30 16:02:43	1.6.2.2
@@ -104,6 +104,10 @@
 
     def runFile(self, filename):
         """Run the test suite defined by filename."""
+        working_dir = os.getcwd()
+        dirname, name = os.path.split(filename)
+        if dirname:
+            os.chdir(dirname)
         self.report('Running: %s' % filename)
         try:    suite=self.getSuiteFromFile(filename)
         except: suite=None
@@ -111,6 +115,7 @@
             self.report('No test suite found in file:\n%s' % filename)
             return
         self.runSuite(suite)
+        os.chdir(working_dir)