Skip to content

Commit d198c37

Browse files
authored
Merge pull request #3101 from snbianco/ASB-28951-cleanup-dir
Fix so that test products are downloaded to temp directory
2 parents 1bdf695 + bfc694c commit d198c37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

astroquery/mast/tests/test_mast_remote.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,13 @@ def test_observations_filter_products(self):
416416
assert isinstance(result, Table)
417417
assert len(result) == sum(products['productType'] == "SCIENCE")
418418

419-
def test_observations_download_products(self, tmpdir):
419+
def test_observations_download_products(self, tmp_path):
420420
def check_filepath(path):
421421
assert os.path.isfile(path)
422-
os.remove(path)
423422

424423
test_obs_id = '25119363'
425424
result = Observations.download_products(test_obs_id,
426-
download_dir=str(tmpdir),
425+
download_dir=tmp_path,
427426
productType=["SCIENCE"],
428427
mrp_only=False)
429428
assert isinstance(result, Table)
@@ -433,7 +432,7 @@ def check_filepath(path):
433432

434433
# just get the curl script
435434
result = Observations.download_products(test_obs_id,
436-
download_dir=str(tmpdir),
435+
download_dir=tmp_path,
437436
curl_flag=True,
438437
productType=["SCIENCE"],
439438
mrp_only=False)
@@ -442,7 +441,8 @@ def check_filepath(path):
442441

443442
# check for row input
444443
result1 = Observations.get_product_list(test_obs_id)
445-
result2 = Observations.download_products(result1[0])
444+
result2 = Observations.download_products(result1[0],
445+
download_dir=tmp_path)
446446
assert isinstance(result2, Table)
447447
check_filepath(result2['Local Path'][0])
448448
assert len(result2) == 1

0 commit comments

Comments
 (0)