Skip to content

Commit 76f5fe9

Browse files
committed
Change some error types to be more appropriate
1 parent 0c65fab commit 76f5fe9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/astro_image_display_api/widget_api_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def test_remove_catalog_does_not_accept_list(self):
616616
self.image.load_catalog(tab, catalog_label='test2', use_skycoord=False)
617617

618618
with pytest.raises(
619-
ValueError,
619+
TypeError,
620620
match='Cannot remove multiple catalogs from a list'
621621
):
622622
self.image.remove_catalog(catalog_label=['test1', 'test2'])
@@ -646,7 +646,7 @@ def test_adding_catalog_as_world(self, data, wcs):
646646
def test_stretch(self):
647647
original_stretch = self.image.get_stretch()
648648

649-
with pytest.raises(ValueError, match=r'Stretch.*not valid.*'):
649+
with pytest.raises(TypeError, match=r'Stretch.*not valid.*'):
650650
self.image.set_stretch('not a valid value')
651651

652652
# A bad value should leave the stretch unchanged
@@ -658,10 +658,10 @@ def test_stretch(self):
658658
assert isinstance(self.image.get_stretch(), LogStretch)
659659

660660
def test_cuts(self, data):
661-
with pytest.raises(ValueError, match='[mM]ust be'):
661+
with pytest.raises(TypeError, match='[mM]ust be'):
662662
self.image.set_cuts('not a valid value')
663663

664-
with pytest.raises(ValueError, match='[mM]ust be'):
664+
with pytest.raises(TypeError, match='[mM]ust be'):
665665
self.image.set_cuts((1, 10, 100))
666666

667667
# Setting using histogram requires data

0 commit comments

Comments
 (0)