Skip to content

Commit

Permalink
Ignore UserWarning for Ubuntu tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Sep 12, 2024
1 parent 766df6a commit ebd3572
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from astropy.modeling import models
from astropy.nddata import StdDevUncertainty
from astropy.tests.helper import assert_quantity_allclose
from astropy.utils.exceptions import AstropyUserWarning
from astropy.wcs import WCS
from glue.core.roi import XRangeROI
from numpy.testing import assert_allclose, assert_array_equal
Expand Down Expand Up @@ -390,7 +391,8 @@ def test_cube_fit_with_nans(cubeviz_helper):
mf = cubeviz_helper.plugins["Model Fitting"]
mf.cube_fit = True
mf.create_model_component("Const1D")
mf.calculate_fit()
with pytest.warns(AstropyUserWarning, match='Model is linear in parameters'):
mf.calculate_fit()
result = cubeviz_helper.app.data_collection['model']
assert np.all(result.get_component("flux").data == 1)

Expand All @@ -410,7 +412,8 @@ def test_cube_fit_with_subset_and_nans(cubeviz_helper):
mf.cube_fit = True
mf.spectral_subset = 'Subset 1'
mf.create_model_component("Const1D")
mf.calculate_fit()
with pytest.warns(AstropyUserWarning, match='Model is linear in parameters'):
mf.calculate_fit()
result = cubeviz_helper.app.data_collection['model']
print(cubeviz_helper.app.data_collection['model'].get_object(statistic=None).flux.max())
assert np.all(result.get_component("flux").data == 1)

0 comments on commit ebd3572

Please sign in to comment.