Skip to content

Commit be0c091

Browse files
committed
MAINT: working around ValueError (somehow new for random.choice)
1 parent 56a3c91 commit be0c091

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

astroquery/esa/hubble/tests/test_esa_hubble_remote.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import tempfile
1313

1414
import os
15+
import numpy as np
1516

1617
import pytest
1718
from astroquery.esa.hubble import ESAHubble
1819
from astropy import coordinates
19-
import random
2020

2121
esa_hubble = ESAHubble()
2222

@@ -58,7 +58,7 @@ def test_query_tap_async(self):
5858

5959
def test_download_product(self):
6060
result = esa_hubble.query_tap(query=self.hst_query)
61-
observation_id = random.choice(result['observation_id'])
61+
observation_id = np.random.choice((result['observation_id']))
6262
temp_file = self.temp_folder.name + "/" + observation_id + ".tar"
6363
esa_hubble.download_product(observation_id=observation_id,
6464
filename=temp_file)
@@ -67,7 +67,7 @@ def test_download_product(self):
6767
def test_get_artifact(self):
6868
result = esa_hubble.query_tap(query=self.top_artifact_query)
6969
assert "artifact_id" in result.keys()
70-
artifact_id = random.choice(result["artifact_id"])
70+
artifact_id = np.random.choice(result["artifact_id"])
7171
temp_file = self.temp_folder.name + "/" + artifact_id + ".gz"
7272
esa_hubble.get_artifact(artifact_id=artifact_id, filename=temp_file)
7373
assert os.path.exists(temp_file)

0 commit comments

Comments
 (0)