[Digicool-CVS] CVS: Releases/Zope/utilities - testrunner.py:1.10.4.1
Evan Simpson
evan@cvs.zope.org
Mon, 6 Aug 2001 13:17:16 -0400
Update of /cvs-repository/Releases/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv1616
Modified Files:
Tag: Zope-2_4-branch
testrunner.py
Log Message:
Make testrunner work with the new unit test framework.
=== Releases/Zope/utilities/testrunner.py 1.10 => 1.10.4.1 ===
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()