Mercurial > bitten > bitten-test
changeset 622:a315e68e012a
0.6dev: Reorganizing gathering of unittests - more readable with regards to what goes where (master vs slave), and also avoids the non-obvious errors from #105 from missing Trac imports in tests.
Thanks to pacopablo for initial patch.
author | osimons |
---|---|
date | Sat, 08 Aug 2009 01:07:21 +0000 |
parents | 394c73ca1a66 |
children | 31954f250366 |
files | bitten/tests/__init__.py |
diffstat | 1 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/bitten/tests/__init__.py +++ b/bitten/tests/__init__.py @@ -9,26 +9,31 @@ # are also available at http://bitten.edgewall.org/wiki/License. import unittest -from bitten.tests import admin, master, model, queue, web_ui, notify -from bitten.slave_tests import slave, recipe -from bitten.build import tests as build -from bitten.report import tests as report -from bitten.util import tests as util -def suite(): + +def master_suite(): + from bitten.tests import admin, master, model, queue, web_ui, notify + from bitten.report import tests as report suite = unittest.TestSuite() suite.addTest(admin.suite()) suite.addTest(master.suite()) suite.addTest(model.suite()) - suite.addTest(recipe.suite()) suite.addTest(queue.suite()) - suite.addTest(slave.suite()) suite.addTest(web_ui.suite()) - suite.addTest(build.suite()) suite.addTest(report.suite()) - suite.addTest(util.suite()) suite.addTest(notify.suite()) return suite +def suite(): + suite = unittest.TestSuite() + try: + import trac + suite.addTest(master_suite()) + except ImportError: + print "\nTrac not installed -- Skipping master tests\n" + import bitten.slave_tests + suite.addTest(bitten.slave_tests.suite()) + return suite + if __name__ == '__main__': unittest.main(defaultTest='suite')