2c71d9d7036c — Carsten Grohmann 6 months ago
Set exit code if tests are failed
1 files changed, 6 insertions(+), 1 deletions(-)

M test.py
M test.py +6 -1
@@ 18,6 18,7 @@ 
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
+import sys
 import unittest
 from JsonDottedReadAccess import JsonDottedReadAccess
 

          
@@ 76,4 77,8 @@ class TestJsonDottedReadAccess(unittest.
 
 if __name__ == '__main__':
     suite = unittest.TestLoader().loadTestsFromTestCase(TestJsonDottedReadAccess)
-    unittest.TextTestRunner(verbosity=2).run(suite)
  No newline at end of file
+    result = unittest.TextTestRunner(verbosity=2).run(suite)
+    if result.wasSuccessful():
+        sys.exit(0)
+    else:
+        sys.exit(1)
  No newline at end of file