[Zope3-checkins] CVS: Zope3 - test.py:1.33

Barry Warsaw barry@wooz.org
Fri, 20 Dec 2002 17:20:43 -0500


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv949

Modified Files:
	test.py 
Log Message:
main(): Try again, by getting the absolute path of the log.ini file
before the path hacking, but importing and init'ing logging after the
path hacking.  XXX This isn't perfect because if log.ini specifies a
log file, it'll be relative to the build directory.  Hmm...


=== Zope3/test.py 1.32 => 1.33 ===
--- Zope3/test.py:1.32	Fri Dec 20 17:14:38 2002
+++ Zope3/test.py	Fri Dec 20 17:20:43 2002
@@ -424,16 +424,22 @@
 
     os.path.walk(os.curdir, remove_stale_bytecode, None)
 
+    # Get the log.ini file from the current directory instead of possibly
+    # buried in the build directory.  XXX This isn't perfect because if
+    # log.ini specifies a log file, it'll be relative to the build directory.
+    # Hmm...
+    logini = os.path.abspath('log.ini')
+
+    # Initialize the path and cwd
+    pathinit = PathInit(build, build_inplace)
+
     # Initialize the logging module.
     import logging.config
     logging.basicConfig()
     logging.root.setLevel(logging.CRITICAL)
     # If log.ini exists, use it
-    if os.path.exists("log.ini"):
-        logging.config.fileConfig("log.ini")
-
-    # Initialize the path and cwd
-    pathinit = PathInit(build, build_inplace)
+    if os.path.exists(logini):
+        logging.config.fileConfig(logini)
 
     files = find_tests(module_filter)
     files.sort()