[Zope-Checkins] CVS: Zope - test.py:1.2.2.13

Stefan H. Holek stefan at epy.co.at
Wed Aug 11 14:22:50 EDT 2004


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv13811

Modified Files:
      Tag: Zope-2_7-branch
	test.py 
Log Message:
Print the path that is actually scanned for tests, not libdir.


=== Zope/test.py 1.2.2.12 => 1.2.2.13 ===
--- Zope/test.py:1.2.2.12	Sat Aug  7 09:44:44 2004
+++ Zope/test.py	Wed Aug 11 14:22:50 2004
@@ -377,15 +377,19 @@
         sys.path.insert(0, os.path.join(self.home, self.libdir))
         self.cwd = os.path.realpath(os.getcwd())
         # Hack again for external products.
-        global functional
-        kind = functional and "functional" or "unit"
         if libdir:
             self.libdir = os.path.realpath(os.path.join(self.cwd, libdir))
         else:
             self.libdir = os.path.realpath(os.path.join(self.cwd, self.libdir))
         if self.libdir not in sys.path:
             sys.path.insert(0, self.libdir)
-        print "Running %s tests from %s" % (kind, self.libdir)
+        # Determine where to look for tests
+        if test_dir:
+            self.testdir = os.path.abspath(os.path.join(self.cwd, test_dir))
+        else:
+            self.testdir = self.libdir
+        kind = functional and "functional" or "unit"
+        print "Running %s tests from %s" % (kind, self.testdir)
 
 def match(rx, s):
     if not rx:
@@ -470,11 +474,7 @@
 def find_tests(rx):
     global finder
     finder = TestFileFinder(pathinit.libdir)
-    if test_dir:
-        walkdir = os.path.abspath(os.path.join(pathinit.cwd, test_dir))
-    else:
-        walkdir = pathinit.libdir
-    walk_with_symlinks(walkdir, finder.visit, rx)
+    walk_with_symlinks(pathinit.testdir, finder.visit, rx)
     return finder.files
 
 def package_import(modname):



More information about the Zope-Checkins mailing list