Skip to content

Commit

Permalink
Changed style of assert_raises
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Berlfein committed Jun 20, 2024
1 parent 9bcc57e commit 13ccd77
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_chromatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1970,14 +1970,16 @@ def __repr__(self):
# check error messages from inconsistent pixel scales and image dimensions
incorrect_ims = PSF.ims.copy()
incorrect_ims[0].scale += 0.01
with assert_raises(galsim.GalSimNotImplementedError):
galsim.InterpolatedChromaticObject.from_images(incorrect_ims, PSF.waves)
#with assert_raises(galsim.GalSimNotImplementedError):
# galsim.InterpolatedChromaticObject.from_images(incorrect_ims, PSF.waves)
assert_raises(galsim.GalSimNotImplementedError, galsim.InterpolatedChromaticObject.from_images, incorrect_ims, PSF.waves)
incorrect_ims[0].scale -= 0.01
smaller_image = incorrect_ims[0].array[1:]
incorrect_img = galsim.Image(smaller_image, scale=scale)
incorrect_ims[0] = incorrect_img
with assert_raises(galsim.GalSimNotImplementedError):
galsim.InterpolatedChromaticObject.from_images(incorrect_ims, PSF.waves)
assert_raises(galsim.GalSimNotImplementedError, galsim.InterpolatedChromaticObject.from_images, incorrect_ims, PSF.waves)
#with assert_raises(galsim.GalSimNotImplementedError):
# galsim.InterpolatedChromaticObject.from_images(incorrect_ims, PSF.waves)


# check input images are correctly intialized from underscored function directly
Expand Down

0 comments on commit 13ccd77

Please sign in to comment.