[Zope-Checkins] CVS: Zope3/lib/python/Zope/Testing - Builder.py:1.1.4.7 common.py:1.3.30.1
Martijn Pieters
mj@zope.com
Wed, 13 Feb 2002 00:03:41 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/Testing
In directory cvs.zope.org:/tmp/cvs-serv14206/Testing
Modified Files:
Tag: Zope-3x-branch
Builder.py common.py
Log Message:
Optimizations and code style updates:
- Use isinstance on type checks
- Test UnicodeType and StringType through StringTypes
- Remove use of the string module
- Use startswith and endswith instead of slices.
- Fix weird tests where isinstance suffices.
=== Zope3/lib/python/Zope/Testing/Builder.py 1.1.4.6 => 1.1.4.7 ===
import unittest
-import sys, os, string
+import sys, os
from fnmatch import fnmatch
import traceback
@@ -85,7 +85,7 @@
"""
header = '[%s] %s' % ( candidate, msg )
errLines = apply( traceback.format_exception, sys.exc_info() )
- body = string.join( errLines, '')
+ body = ''.join(errLines)
return header, body
def _recordLoadFailure( self, candidate, msg ):
=== Zope3/lib/python/Zope/Testing/common.py 1.3 => 1.3.30.1 ===
+
# Default test runner
TestRunner = unittest.TextTestRunner
@@ -20,7 +22,6 @@
def test_suite():
# The default test suite includes every subclass of TestCase in
# the module, with 'test' as the test method prefix.
- ClassType = type(unittest.TestCase)
tests = []
for v in globals().values():
if isinstance(v, ClassType) and issubclass(v, unittest.TestCase):