From cf45a7a732d48482665de9a1be4e99347f61a9cc Mon Sep 17 00:00:00 2001 From: gauravp94 Date: Mon, 17 Mar 2014 00:25:24 +0530 Subject: [PATCH] Add verbosity to the activity tests --- src/sugar3/activity/bundlebuilder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sugar3/activity/bundlebuilder.py b/src/sugar3/activity/bundlebuilder.py index 7a9031eb..7285e66e 100644 --- a/src/sugar3/activity/bundlebuilder.py +++ b/src/sugar3/activity/bundlebuilder.py @@ -287,7 +287,7 @@ def cmd_check(config, options): # Run Tests if os.path.isdir(unit_test_path) and run_unit_test: all_tests = unittest.defaultTestLoader.discover(unit_test_path) - unittest.TextTestRunner().run(all_tests) + unittest.TextTestRunner(verbosity=options.verbose).run(all_tests) elif not run_unit_test: print "Not running unit tests" else: @@ -296,7 +296,7 @@ def cmd_check(config, options): if os.path.isdir(integration_test_path) and run_integration_test: all_tests = unittest.defaultTestLoader.discover( integration_test_path) - unittest.TextTestRunner().run(all_tests) + unittest.TextTestRunner(verbosity=options.verbose).run(all_tests) elif not run_integration_test: print "Not running integration tests" else: @@ -419,6 +419,10 @@ def start(): check_parser.add_argument("choice", nargs='?', choices=['unit', 'integration'], help="run unit/integration test") + check_parser.add_argument("--verbosity", "-v", dest="verbose", + type=int, choices=range(0, 3), + default=1, nargs='?', + help="verbosity for the unit tests") subparsers.add_parser("dist_xo", help="Create a xo bundle package") subparsers.add_parser("dist_source", help="Create a tar source package")