Skip to content

Commit ad6c612

Browse files
committed
Update tests to ignore warnings
style fix
1 parent d02d1c2 commit ad6c612

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

astroquery/mast/tests/test_mast.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import os
55
import re
6+
import warnings
67
from shutil import copyfile
78
from unittest.mock import patch
89

@@ -646,11 +647,9 @@ def test_resolve_object_multi(patch_post):
646647
assert isinstance(obj_dict["SIMBAD"], SkyCoord)
647648

648649
# Error if none of the objects can be resolved
649-
with pytest.warns(InputWarning, match='Could not resolve "nonexisting1" to a sky position.'):
650-
with pytest.warns(InputWarning, match='Could not resolve "nonexisting2" to a sky position.'):
651-
with pytest.raises(ResolverError, match='Could not resolve any of the given object names to '
652-
'sky positions.'):
653-
mast.Mast.resolve_object(["nonexisting1", "nonexisting2"])
650+
warnings.simplefilter("ignore", category=InputWarning) # ignore warnings
651+
with pytest.raises(ResolverError, match='Could not resolve any of the given object names to sky positions.'):
652+
mast.Mast.resolve_object(["nonexisting1", "nonexisting2"])
654653

655654

656655
def test_login_logout(patch_post):

0 commit comments

Comments
 (0)