瀏覽代碼

[core] Fix test runner return code

Romain Rigaux 12 年之前
父節點
當前提交
76abc7877e
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      desktop/core/src/desktop/management/commands/test.py

+ 5 - 5
desktop/core/src/desktop/management/commands/test.py

@@ -42,7 +42,7 @@ class Command(BaseCommand):
                  Additional arguments are passed to nose.
                  Additional arguments are passed to nose.
 
 
       fast       Runs the "fast" tests, namely those that don't start Hadoop.
       fast       Runs the "fast" tests, namely those that don't start Hadoop.
-              
+
       specific   Explicitly run specific tests using nose.
       specific   Explicitly run specific tests using nose.
                  For example, to run all the filebrower tests or
                  For example, to run all the filebrower tests or
                  to run a specific test function, use
                  to run a specific test function, use
@@ -100,8 +100,8 @@ class Command(BaseCommand):
       test_runner = TestRunner(verbosity=1, interactive=False)
       test_runner = TestRunner(verbosity=1, interactive=False)
       nose_args.remove(args[0])
       nose_args.remove(args[0])
       ret = test_runner.run_tests(nose_args)
       ret = test_runner.run_tests(nose_args)
-    
-    if ret:
-      logging.info("Tests (%s) returned %s" % (' '.join(nose_args), ret))
-    else:
+
+    logging.info("Tests (%s) returned %s" % (' '.join(nose_args), ret))
+
+    if ret != 0:
       sys.exit(1)
       sys.exit(1)