From 8e85bf6f267a1b049ccc9092cf73aa149b97647c Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 4 Dec 2015 23:26:13 +0100 Subject: [PATCH] Add path to test_python.py file to system path so that import statements also work for absolute imports that are used as standard in Python 3. Also always exist with sys.exit() so that errors are correctly catched by Jenkins. --- test/test_python.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/test_python.py b/test/test_python.py index e603201..4904907 100755 --- a/test/test_python.py +++ b/test/test_python.py @@ -22,6 +22,7 @@ import gammalib import ctools import sys import os +sys.path.append(os.path.dirname(os.path.abspath(__file__))) import test_ctobssim import test_ctselect import test_ctbin @@ -142,8 +143,8 @@ def test(installed=False): else: rc = 1 - # Return - return rc + # Exit with return code + sys.exit(rc) # ======================== # @@ -154,7 +155,4 @@ if __name__ == '__main__': Perform unit testing for Python interface. """ # Run tests - rc = test() - - # Exit with return code - sys.exit(rc) + test() -- libgit2 0.21.4