Indicate test failure with an exit code.
authorZac Medico <zmedico@gentoo.org>
Fri, 8 Dec 2006 18:34:56 +0000 (18:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 8 Dec 2006 18:34:56 +0000 (18:34 -0000)
svn path=/main/trunk/; revision=5227

tests/__init__.py
tests/runTests

index 1a235ff26f6bd174473e72f4a1b0901be84063f7..6acf0c99f6addf4ae89ce0666fed7751ce7426de 100644 (file)
@@ -18,4 +18,4 @@ def main():
                except ImportError:
                        pass
 
-       unittest.TextTestRunner(verbosity=2).run(suite) 
+       return unittest.TextTestRunner(verbosity=2).run(suite)
index 74b853f0972bf71e0501913882738bd0d494410f..fed58f75db8a88f17c4f15f4a93bb1461b4d87d9 100755 (executable)
@@ -16,5 +16,7 @@ sys.path.insert(0,'../pym')
 sys.path.insert(0, osp.dirname(osp.dirname(osp.abspath(__file__))))
 
 import tests
-
-tests.main()
+if __name__ == "__main__":
+       result = tests.main()
+       if result.failures:
+               sys.exit(1)