File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
astroquery/astrometry_net/tests Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,15 @@ def data_path(filename):
13
13
return os .path .join (DATA_DIR , filename )
14
14
15
15
16
- def test_api_key_property (caplog ):
16
+ def test_api_key_property ():
17
17
"""
18
18
Check that an empty key is returned if the api key is not in
19
19
the configuration file and that the expected message shows up in
20
20
the log.
21
21
"""
22
- caplog .clear ()
23
22
anet = AstrometryNet ()
24
- key = anet .api_key
25
- assert not key
26
- assert "Astrometry.net API key not in configuration file" in caplog .text
23
+ with pytest .raises (RuntimeError , match = 'Astrometry.net API key not set' ):
24
+ anet .api_key
27
25
28
26
29
27
def test_empty_settings_property ():
@@ -56,9 +54,8 @@ def test_login_fails_with_no_api_key():
56
54
"""
57
55
anet = AstrometryNet ()
58
56
anet .api_key = ''
59
- with pytest .raises (RuntimeError ) as e :
57
+ with pytest .raises (RuntimeError , match = 'Astrometry.net API key not set' ) :
60
58
anet ._login ()
61
- assert "You must set the API key before using this service." in str (e .value )
62
59
63
60
64
61
def test_construct_payload ():
You can’t perform that action at this time.
0 commit comments