[Zodb-checkins] CVS: StandaloneZODB - test.py:1.10.6.1

Jeremy Hylton jeremy@zope.com
Tue, 18 Dec 2001 19:09:43 -0500


Update of /cvs-repository/StandaloneZODB
In directory cvs.zope.org:/tmp/cvs-serv30886

Modified Files:
      Tag: Standby-branch
	test.py 
Log Message:
Make sure we only run tests for the build dir for current Python version.

Make PLAT_SPEC a global and check it in TestFileFinder.  Otherwise the
number of times you run a test is equal to the number of Python
versions you've built the module for.



=== StandaloneZODB/test.py 1.10 => 1.10.6.1 ===
 # setup list of directories to put on the path
 
+PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
+
 def setup_path():
-    PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
     DIRS = ["lib",
             "lib.%s" % PLAT_SPEC,
             "../ExtensionClass/build/lib.%s" % PLAT_SPEC,
@@ -56,6 +57,9 @@
         for file in files:
             if file[:4] == "test" and file[-3:] == ".py":
                 path = os.path.join(dir, file)
+                if path.find(PLAT_SPEC) == -1:
+                    # build for a different version
+                    continue
                 if rx is not None:
                     if rx.search(path):
                         self.files.append(path)