[Digicool-CVS] CVS: Releases/Zope/utilities - testrunner.py:1.11

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


Update of /cvs-repository/Releases/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv1816

Modified Files:
	testrunner.py 
Log Message:
Merge unit test change from 2.4 branch


=== Releases/Zope/utilities/testrunner.py 1.10 => 1.11 ===
 
     def smellsLikeATest(self, filepath, find=string.find):
-        file=open(filepath, 'r')
-        lines=file.readlines()
+        file = open(filepath, 'r')
+        text = file.read()
         file.close()
-        for line in lines:
-            if find(line, 'def test_suite(') > -1:
-                return 1
-        return 0
+        return ((find(text, 'unittest') > -1) or
+                (find(text, 'framework.py') > -1))
 
     def runSuite(self, suite):
         runner=pyunit.TextTestRunner()