def alltests(): # use the zope.testing testrunner machinery to find all the # test suites we've put under ourselves from zope.testing.testrunner import get_options from zope.testing.testrunner import find_suites from zope.testing.testrunner import configure_logging configure_logging() from unittest import TestSuite here = os.path.abspath(os.path.dirname(sys.argv[0])) args = sys.argv[:] src = os.path.join(here, 'src') defaults = ['--test-path', src] options = get_options(args, defaults) suites = list(find_suites(options)) return TestSuite(suites)
def alltests(): # use the zope.testing testrunner machinery to find all the # test suites we've put under ourselves try: from zope.testing.testrunner import get_options except ImportError: from zope.testing.testrunner.options import get_options try: from zope.testing.testrunner import find_suites except ImportError: from zope.testing.testrunner.find import find_suites try: from zope.testing.testrunner import configure_logging configure_logging() except ImportError: pass from unittest import TestSuite here = os.path.abspath(os.path.dirname(sys.argv[0])) args = sys.argv[:] defaults = ['--test-path', here] options = get_options(args, defaults) suites = list(find_suites(options)) return TestSuite(suites)
def run(test_suite): options = testrunner.get_options() options.resume_layer = None options.resume_number = 0 testrunner.run_with_options(options, test_suite)