[Zope-Checkins] CVS: Packages/Testing - ZODButil.py:1.1.2.1 common.py:1.1.2.1 custom_zodb.py:1.1.2.1 __init__.py:1.2.36.1

Evan Simpson evan@cvs.zope.org
Mon, 6 Aug 2001 13:16:13 -0400


Update of /cvs-repository/Packages/Testing
In directory cvs.zope.org:/tmp/cvs-serv1419/Testing

Modified Files:
      Tag: Zope-2_4-branch
	__init__.py 
Added Files:
      Tag: Zope-2_4-branch
	ZODButil.py common.py custom_zodb.py 
Log Message:
Added new unit test framework, changed several test suites to use it.


=== Added File Packages/Testing/ZODButil.py ===


=== Added File Packages/Testing/common.py ===


=== Added File Packages/Testing/custom_zodb.py ===


=== Packages/Testing/__init__.py 1.2 => 1.2.36.1 ===
 $Id$
 """
-import os, sys
-startfrom = head = os.getcwd()
+import os
 
-while 1:
-    sys.path[0]=startfrom
-    try:
-        import ZODB
-    except ImportError:
-        head = os.path.split(startfrom)[0]
-        if head == '':
-            raise "Couldn't import ZODB"
-        startfrom = head
-        continue
-    else:
-        break
+def pdir(path):
+    return os.path.split(path)[0]
 
-os.environ['SOFTWARE_HOME']=os.environ.get('SOFTWARE_HOME', startfrom)
+# Set the INSTANCE_HOME to the Testing package directory
+os.environ['INSTANCE_HOME'] = INSTANCE_HOME = pdir(__file__)
 
-os.environ['INSTANCE_HOME']=os.environ.get(
-    'INSTANCE_HOME',
-    os.path.join(os.environ['SOFTWARE_HOME'],'..','..')
-    )
+# Set the SOFTWARE_HOME to the directory containing the Testing package
+os.environ['SOFTWARE_HOME'] = SOFTWARE_HOME = pdir(INSTANCE_HOME)
+
+# Prevent useless initialization by pretending to be a ZEO client
+os.environ['ZEO_CLIENT'] = '1'