Skip to content

Commit 950a56d

Browse files
committed
TST: test for 1 warning
1 parent 3f16e62 commit 950a56d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

astroquery/simbad/tests/test_simbad.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,14 @@ def test_votable_fields():
347347
sb.add_votable_fields('rot', 'z_value', 'velocity')
348348
assert (set(sb.get_votable_fields())
349349
== set(['main_id', 'coordinates', 'rot', 'z_value', 'velocity']))
350-
try:
351-
sb.add_votable_fields('velocity')
352-
except KeyError:
353-
pass # this is the expected response
350+
354351
assert (set(sb.get_votable_fields())
355352
== set(['main_id', 'coordinates', 'rot', 'z_value', 'velocity']))
356353
sb.remove_votable_fields('rot', 'main_id', 'coordinates')
357354
assert set(sb.get_votable_fields()) == set(['z_value', 'velocity'])
358355
# Warning is expected as we removed the 'coordinates' field above:
359356
with pytest.warns(UserWarning, match="coordinates: this field is not set"):
360-
sb.remove_votable_fields('rot', 'main_id', 'coordinates')
357+
sb.remove_votable_fields('coordinates')
361358
assert set(sb.get_votable_fields()) == set(['z_value', 'velocity'])
362359
with pytest.warns(UserWarning, match="All fields have been removed. Resetting"):
363360
sb.remove_votable_fields('z_value', 'velocity')

0 commit comments

Comments
 (0)