Commit c001eecb3d2dfbe828824663f70a7b815cd8d4d8
1 parent
e34ad9cd
Put back exception tests.
The exception problem has been solved by adding a specific @GExceptionHandler@ catch to the Python interface exception handler. We thus can put back the exception tests.
Showing
2 changed files
with
16 additions
and
16 deletions
test/test_GApplication.py
| ... | ... | @@ -160,14 +160,14 @@ class Test(GPythonTestSuite): |
| 160 | 160 | Test GPars. |
| 161 | 161 | """ |
| 162 | 162 | # Test GPars constructor with bad filename. |
| 163 | - #self.test_try("Test GPars constructor with bad filename") | |
| 164 | - #try: | |
| 165 | - # pars = GPars("testme.par") | |
| 166 | - # self.test_try_failure("Exception not thrown.") | |
| 167 | - #except: | |
| 168 | - # self.test_try_success() | |
| 169 | - #else: | |
| 170 | - # self.test_try_failure("This should never happen.") | |
| 163 | + self.test_try("Test GPars constructor with bad filename") | |
| 164 | + try: | |
| 165 | + pars = GPars("testme.par") | |
| 166 | + self.test_try_failure("Exception not thrown.") | |
| 167 | + except: | |
| 168 | + self.test_try_success() | |
| 169 | + else: | |
| 170 | + self.test_try_failure("This should never happen.") | |
| 171 | 171 | |
| 172 | 172 | # Return |
| 173 | 173 | return | ... | ... |
test/test_GSky.py
| ... | ... | @@ -169,14 +169,14 @@ class Test(GPythonTestSuite): |
| 169 | 169 | self.test_skymap_pixels(pixels, "HEALPix") |
| 170 | 170 | |
| 171 | 171 | # Save HEALPix skymap twice. The second saving should fail. |
| 172 | - #try: | |
| 173 | - # pixels.save(file2, True) | |
| 174 | - # pixels.save(file2) | |
| 175 | - #except RuntimeError: | |
| 176 | - # pass | |
| 177 | - #else: | |
| 178 | - # raise RuntimeError("*** TEST ERROR: FITS file overwritten!") | |
| 179 | - #pixels.save(file2, True) | |
| 172 | + try: | |
| 173 | + pixels.save(file2, True) | |
| 174 | + pixels.save(file2) | |
| 175 | + except RuntimeError: | |
| 176 | + pass | |
| 177 | + else: | |
| 178 | + raise RuntimeError("*** TEST ERROR: FITS file overwritten!") | |
| 179 | + pixels.save(file2, True) | |
| 180 | 180 | |
| 181 | 181 | # Load again HEALPix skymap |
| 182 | 182 | pixels = GSkymap(file1) | ... | ... |