File: testsuite_improvements.patch

package info (click to toggle)
python-gdata 2.0.18%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 8,460 kB
  • ctags: 17,143
  • sloc: python: 70,779; ansic: 150; makefile: 27; sh: 3
file content (25 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Author: Dmitry Shachnev <mitya57@gmail.com>
Description: make tests return non-zero value on failures, and increase verbosity
Forwarded: not-needed
Last-Update: 2013-05-24

--- a/tests/module_test_runner.py
+++ b/tests/module_test_runner.py
@@ -41,7 +41,7 @@
     It also sets any module variables which match the settings keys to the
     corresponding values in the settings member.
     """
-    runner = unittest.TextTestRunner()
+    runner = unittest.TextTestRunner(verbosity=2)
     for module in self.modules:
       # Set any module variables according to the contents in the settings
       for setting, value in self.settings.iteritems():
@@ -53,5 +53,6 @@
           pass
       # We have set all of the applicable settings for the module, now
       # run the tests.
-      print '\nRunning all tests in module', module.__name__
-      runner.run(unittest.defaultTestLoader.loadTestsFromModule(module))    
+      result = runner.run(unittest.defaultTestLoader.loadTestsFromModule(module))
+      if not result.wasSuccessful():
+        raise Exception('Tests failed!')