[Zope-Checkins] CVS: Zope3 - test.py:1.1.2.3
Chris Withers
chrisw@nipltd.com
Wed, 27 Feb 2002 19:04:30 -0500
Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv8320
Modified Files:
Tag: Zope-3x-branch
test.py
Log Message:
de-unix-ify
=== Zope3/test.py 1.1.2.2 => 1.1.2.3 ===
import traceback
import unittest
+from os.path import join
from distutils.util import get_platform
@@ -112,13 +113,13 @@
# setup list of directories to put on the path
def setup_path():
- DIRS = ["lib/python",
- "lib/python/ZopeLegacy",
- "lib/python/ZopeLegacy/ExtensionClass",
+ DIRS = [join('lib','python'),
+ join('lib','python','ZopeLegacy'),
+ join('lib','python','ZopeLegacy','ExtensionClass')
]
cwd = os.getcwd()
for d in DIRS:
- sys.path.insert(0, os.path.join(cwd, d))
+ sys.path.insert(0, join(cwd, d))
def match(rx, s):
if not rx:
@@ -136,7 +137,7 @@
if dir[-5:] != "tests":
return
# ignore tests in ZopeLegacy directory
- if dir.startswith('lib/python/ZopeLegacy'):
+ if dir.startswith(join('lib','python','ZopeLegacy')):
return
# ignore tests that aren't in packages
if not "__init__.py" in files:
@@ -144,13 +145,13 @@
return
for file in files:
if file[:4] == "test" and file[-3:] == ".py":
- path = os.path.join(dir, file)
+ path = join(dir, file)
if match(rx, path):
self.files.append(path)
def find_tests(rx):
finder = TestFileFinder()
- os.path.walk("lib/python", finder.visit, rx)
+ os.path.walk(join('lib','python'), finder.visit, rx)
return finder.files
def package_import(modname):
@@ -179,7 +180,7 @@
print "Error importing %s\n%s" % (modname, err)
return None
try:
- return mod.test_suite()
+ return mod.test_suite()
except AttributeError:
print "No test_suite() in %s" % file