from unittest import TestSuite import os import sys def test_suite(): suite = TestSuite() pkg_path = os.path.dirname(__file__) sys.path.append(pkg_path) from p4a.z2utils.tests import test_all suite.addTest(test_all.test_suite()) for x in ('p4a.fileimage.tests', 'p4a.common.tests', 'p4a.calendar.browser.tests', 'p4a.plonecalendar.tests', 'p4a.audio.tests.test_docunittests', 'p4a.ploneaudio.tests', 'p4a.video.tests.test_docunittests', 'p4a.plonevideo.tests', 'p4a.videoembed.tests', 'p4a.plonevideoembed.tests'): try: m = __import__(x, (), (), x) new_suite = m.test_suite() suite.addTest(new_suite) except Exception, e: raise e.__class__('While handling module "%s" got ' 'exception: %s' % (x, str(e))) return suite