Skip to content

Commit

Permalink
TST: Handle empty warning in #128
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Feb 19, 2021
1 parent 7abdf62 commit d4c0c36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion astrowidgets/tests/test_widget_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def test_add_markers(self):
self.image.remove_all_markers()
assert len(self.image.get_marker_names()) == 0
assert self.image.get_all_markers() is None
assert self.image.get_markers_by_name(self.image._default_mark_tag_name) is None
with pytest.warns(UserWarning, match='is empty'):
assert self.image.get_markers_by_name(self.image._default_mark_tag_name) is None

with pytest.raises(ValueError, match="No markers named 'test1'"):
self.image.get_markers_by_name('test1')
Expand Down
3 changes: 2 additions & 1 deletion astrowidgets/tests/test_widget_with_wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def test_empty_marker_name_works_with_all(self):

assert self.image.get_marker_names() == ['empty', 'nowcs']

marks = self.image.get_all_markers()
with pytest.warns(UserWarning, match='is empty'):
marks = self.image.get_all_markers()
assert len(marks) == len(x)
assert 'empty' not in marks['marker name']

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ filterwarnings =
ignore:numpy.ufunc size changed:RuntimeWarning
ignore:numpy.ndarray size changed:RuntimeWarning
ignore::DeprecationWarning:ginga
ignore:Marker set named:UserWarning

[flake8]
# E501: line too long
Expand Down

0 comments on commit d4c0c36

Please sign in to comment.