[Zope-CMF] testrunner from
http://www.zope.org/Members/shh/TestRunner runs tests twice
Gregoire Weber
gregoire.weber@switzerland.org
Sat, 01 Mar 2003 23:11:52 +0100
It is because testrunner runs 'test_all.py' which runs=20
'test_test.py' (see below) and testrunner runs 'test_test.py'.
But the the question arises why CMF Products have this=20
"test_all.py"?
Sorry for the noise!
Gregoire
# test_all.py
import Zope
try:
Zope.startup()
except NameError: # pre Zope 2.6.1
pass
from unittest import main
from Products.CMFCore.tests.base.utils import build_test_suite
def test_suite():
return build_test_suite('Products.CMFCollection.tests',[
'test_test', ### started a second time
])
if __name__ =3D=3D '__main__':
main(defaultTest=3D'test_suite')
At 22:55 01.03.2003 +0100, Gr=E9goire Weber wrote:
>Hi Stefan,
>
>your testrunner thankfully helped me running my unit tests!
>
>One low priority question remains:
>
> Why are the test runned twice?
> I use Zope 2.6.1b2 and CMF 1.3 on Win2k.
> I didn't set INSTANCE_HOME because it was not necessary.
>
>Gregoire
>
># On the Win2k Command Prompt:
># Remarks:=20
># - The first two lines are actualy one line!
># - testrunner2.py is your testrunner from=20
># http://www.zope.org/Members/shh/TestRunner)
># - To see the paths I added to my test_all.py:
># import sys=20
># print '--------------------------------'
># print '\n'.join(sys.path)
># print '--------------------------------'
>
>D:\Program Files\zope\zope26>python utilities\testrunner2.py -d=
E:\user\greg\data\Zope\inst\zope_dev\Products\CMFCollection -i
>
>Adding E:\user\greg\data\Zope\inst\zope_dev\Products to products path.
>--------------------------------
>D:\Program Files\zope\zope26\lib\python
>D:\Program Files\zope\zope26\bin\lib
>D:\Program Files\zope\zope26\bin\lib\plat-win
>D:\Program Files\zope\zope26\bin\lib\win32
>D:\Program Files\zope\zope26\bin\lib\win32\lib
>D:\Program Files\zope\zope26
>utilities
>D:\Program Files\zope\zope26\bin\DLLs
>D:\Program Files\zope\zope26\bin\lib
>D:\Program Files\zope\zope26\bin\lib\plat-win
>D:\Program Files\zope\zope26\bin\lib\lib-tk
>D:\Program Files\zope\zope26\bin
>
>--------------------------------
>test_test (Products.CMFCollection.tests.test_test.Test) ... ok
>test_test (test_test.Test) ... ok
>
>----------------------------------------------------------------------
>Ran 2 tests in 0.000s
>
>OK
>_____________________________________
>Gr=E9goire Weber
>Rigistr. 31
>CH-8006 Z=FCrich
>Switzerland
>phone: +41-(0)1-361 66 11
>mobile: +41-(0)79-44 11 457
>mailto:gregoire.weber@switzerland.org
>
>
>_______________________________________________
>Zope-CMF maillist - Zope-CMF@zope.org
>http://mail.zope.org/mailman/listinfo/zope-cmf
>
>See http://collector.zope.org/CMF for bug reports and feature requests
_____________________________________
Gr=E9goire Weber
mailto:gregoire.weber@switzerland.org