Skip to content

Commit

Permalink
Try using a difference Vizier server to fix frequent CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton committed Jan 9, 2024
1 parent 8059066 commit 48f8e07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/pyradiosky/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,18 @@ def download_gleam(
from astroquery.vizier import Vizier
except ImportError as e:
raise ImportError(
"The astroquery module required to use the download_gleam function."
"The astroquery module is required to use the download_gleam function."
) from e

if for_testing: # pragma: no cover
path = SKY_DATA_PATH
filename = "gleam_50srcs.vot"
overwrite = True
row_limit = 50
# We have frequent CI failures with messages like
# "Failed to resolve 'vizier.u-strasbg.fr'"
# Try using a US mirror to see if we have fewer errors
Vizier.VIZIER_SERVER = "vizier.cfa.harvard.edu"

opath = os.path.join(path, filename)
if os.path.exists(opath) and not overwrite:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_astroquery_missing_error(tmp_path):
except ImportError:
with pytest.raises(
ImportError,
match="The astroquery module required to use the download_gleam function.",
match="The astroquery module is required to use the download_gleam function.",
):
skyutils.download_gleam(path=tmp_path, filename=fname, row_limit=10)

Expand Down

0 comments on commit 48f8e07

Please sign in to comment.