Commit 7881d67051c4f19b24b248a263eb8f85b842a3a7

Authored by Jürgen Knödlseder
2 parents 18b7c535 166d83b7

Merge branch 'integration' into devel

ChangeLog
1   -2017-03-28
  1 +2017-04-04
2 2  
3 3 * Version 1.3.0 released
4 4 ========================
5 5  
  6 + Raise exception instead of exiting with return code in Python tests (#1983)
6 7 Support of map cubes lying outside RoI in ctobssim
7 8 Support energy boundary FITS file in ctmapcube (#1978)
8 9 Add csebins script (#1976)
... ...
1 1 New Features and Important Changes in ctools 1.3.0.dev1
2 2  
3   -28 March 2017
  3 +4 April 2017
4 4  
5 5  
6 6 Introduction
... ... @@ -11,7 +11,9 @@ ctools release with respect to the precedent release.
11 11  
12 12 Configuration
13 13 -------------
14   -None
  14 +The Python unit tests now raise exceptions instead of exiting with a non-
  15 +zero return code so that the user is not thrown out of Python after calling
  16 +ctools.test() and cscripts.test() (#1983).
15 17  
16 18  
17 19 Python interface
... ...
test/test_ctbin.py
... ... @@ -30,7 +30,7 @@ from testing import test
30 30 class Test(test):
31 31 """
32 32 Test class for ctbin tool
33   -
  33 +
34 34 This test class makes unit tests for the ctbin tool by using it from
35 35 the command line and from Python.
36 36 """
... ... @@ -280,7 +280,7 @@ class Test(test):
280 280 def _check_observation(self, ctbin, nevents, multiplier=1):
281 281 """
282 282 Check content of an observation
283   -
  283 +
284 284 Parameters
285 285 ----------
286 286 ctbin : `~ctools.ctbin`
... ... @@ -316,7 +316,7 @@ class Test(test):
316 316 def _check_cube(self, cube, nevents, multiplier=1):
317 317 """
318 318 Check content of event cube
319   -
  319 +
320 320 Parameters
321 321 ----------
322 322 cube : `~gammalib.GCTAEventCube`
... ...
test/test_examples.py.in
... ... @@ -532,5 +532,6 @@ if __name__ == '__main__':
532 532 else:
533 533 rc = 1
534 534  
535   - # Exit with return code
536   - sys.exit(rc)
  535 + # Raise an exception in case of failure
  536 + if not success:
  537 + raise RuntimeError('At least one error occured during the test.')
... ...
test/test_python_cscripts.py
... ... @@ -184,8 +184,9 @@ def test(installed=False, debug=False):
184 184 if installed:
185 185 os.system('rm -rf %s' % (path))
186 186  
187   - # Exit with return code
188   - sys.exit(rc)
  187 + # Raise an exception in case of failure
  188 + if not success:
  189 + raise RuntimeError('At least one error occured during the test.')
189 190  
190 191  
191 192 # ======================== #
... ...
test/test_python_ctools.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # This scripts performs unit tests for the ctools package
4 4 #
5   -# Copyright (C) 2012-2016 Juergen Knoedlseder
  5 +# Copyright (C) 2012-2017 Juergen Knoedlseder
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # it under the terms of the GNU General Public License as published by
... ... @@ -143,8 +143,9 @@ def test(installed=False):
143 143 if installed:
144 144 os.system('rm -rf %s' % (path))
145 145  
146   - # Exit with return code
147   - sys.exit(rc)
  146 + # Raise an exception in case of failure
  147 + if not success:
  148 + raise RuntimeError('At least one error occured during the test.')
148 149  
149 150  
150 151 # ======================== #
... ...