Testoob: How do you use testoob.collector_from_globals / collector_from_modules?

Harry Ebbers nemelis at gmail.com
Mon Jul 27 09:12:39 EDT 2009


Hi,

For a project I'm creating unittests using testoob. When all tests are
in a single file there is no problem

if __name__ == '__main__':
    testoob.main()
 does the trick as usual.

But for a number of python-applications they have asked me to group
unittests in different files, based on common functionality (e.g. GUI,
main-application, etcetera).

Ican get it to work by importing all unittestclasses in the following
way and than use the normal if __name__ == '__main__' construction

(from GUI import GUItests
from APP import APPtests

if __name__ == '__main__':
    testoob.main())

But looking at the future I would like to use testsuites.

On the internet I found the functions testoob.collector_from_globals
and collector_from_modules which one can use to 'easily' create
testsuites which can be used with testoob. But no examples on how to
use them can be found.

Can anybody supply me with a working example?

TIA

Harry Ebbers



More information about the Python-list mailing list