Skip to content

Commit

Permalink
corrections to check for multiple warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jun 3, 2024
1 parent 77df5ff commit fc28c86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions jdaviz/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def test_url_to_download_imviz_local_path_warning(imviz_helper):
'MAST URIs.*astropy download cache instead.*'
)
with (
pytest.warns(UserWarning, match=match_local_path_msg),
pytest.warns(FITSFixedWarning, match="'datfix' made the change")
pytest.warns(FITSFixedWarning, match="'datfix' made the change"),
pytest.warns(UserWarning, match=match_local_path_msg)
):
imviz_helper.load_data(url, cache=False, local_path='horsehead.fits')
imviz_helper.load_data(url, cache=True, local_path='horsehead.fits')


@pytest.mark.remote_data
Expand Down
5 changes: 1 addition & 4 deletions jdaviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,7 @@ def download_uri_to_path(possible_uri, cache=None, local_path=os.curdir, timeout
# if you give a directory, save the file there with default name:
local_path = os.path.join(local_path, parsed_uri.path.split(os.path.sep)[-1])

if timeout is None:
timeout = conf.timeout.defaultvalue

with conf.timeout.set_temp(timeout):
with conf.set_temp('timeout', timeout):
(status, msg, url) = Observations.download_file(
possible_uri, cache=cache, local_path=local_path
)
Expand Down

0 comments on commit fc28c86

Please sign in to comment.