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

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


Update of /cvs-repository/Zope2/utilities
In directory korak:/home/brian/temp/mainline_test/utilities

Modified Files:
	testrunner.py 
Log Message:
Merged fix to cd to test directories in testrunner



--- Updated File testrunner.py in package Zope2 --
--- testrunner.py	2001/02/12 14:57:31	1.7
+++ testrunner.py	2001/03/30 16:03:11	1.8
@@ -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)