File: exit_failure_tests.diff

package info (click to toggle)
python-crontab 1.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 356 kB
  • ctags: 494
  • sloc: python: 1,520; makefile: 8; sh: 8
file content (12 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# From: Jordan Metzmeier <jmetzmeier01@gmail.com>
# Subject: Make unit test running exit non-zero on test failure
# This is added so that package build will fail if unit tests fail
# during the build
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -7,3 +7,5 @@
     suites = [unittest.defaultTestLoader.loadTestsFromName(s) for s in modules]
     testSuite = unittest.TestSuite(suites)
     text_runner = unittest.TextTestRunner().run(testSuite)
+    if text_runner.errors or text_runner.failures:
+        raise SystemExit("Some unit tests failed")