[Zope-CVS] CVS: Packages/TestScripts - backgroundtester.py:1.2

Jens Vagelpohl jens@zope.com
Thu, 24 Jan 2002 15:46:23 -0500


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

Modified Files:
	backgroundtester.py 
Log Message:
Tweak to make sure the tests are happening in the right place



=== Packages/TestScripts/backgroundtester.py 1.1 => 1.2 ===
 """
 
-import os, time, smtplib
+import os, time, smtplib, sys
 
 def _get_time( format='date'):
     """ Get a nice time representation """
@@ -177,7 +177,10 @@
     pkgs = ', '.join( PACKAGES.keys() )
     msg = '*** Zope unit tests with packages %s (%s) ***\n\n'
     LOG_BUFFER.append( msg % ( pkgs, _get_time() ) )
-    HOME = os.getcwd()
+    module_path = sys.argv[0]
+    module_dir, module_filename = os.path.split( module_path )
+    os.chdir( module_dir )
+    HOME = module_dir
     os.environ['CVSROOT'] = CVSROOT
 
     _cleanup( HOME )