From 7b748278850e3a5c210aae149d79cd9db5053099 Mon Sep 17 00:00:00 2001 From: "T. E. Pickering" Date: Thu, 6 Apr 2023 13:01:50 -0700 Subject: [PATCH] mark the tests that download remote data --- specreduce/tests/test_extinction.py | 6 ++++++ specreduce/tests/test_get_reference_file_path.py | 4 ++++ specreduce/tests/test_linelists.py | 4 ++++ specreduce/tests/test_specphot_stds.py | 4 ++++ specreduce/tests/test_synth_data.py | 3 +++ 5 files changed, 21 insertions(+) diff --git a/specreduce/tests/test_extinction.py b/specreduce/tests/test_extinction.py index 45d9cf70..000587c4 100644 --- a/specreduce/tests/test_extinction.py +++ b/specreduce/tests/test_extinction.py @@ -12,6 +12,7 @@ ) +@pytest.mark.remote_data def test_supported_models(): """ Test loading of supported models @@ -22,6 +23,7 @@ def test_supported_models(): assert len(ext.transmission) > 0 +@pytest.mark.remote_data def test_custom_mag_model(): """ Test creation of custom model from Quantity arrays @@ -33,6 +35,7 @@ def test_custom_mag_model(): assert len(ext.transmission) > 0 +@pytest.mark.remote_data def test_custom_raw_mag_model(): """ Test creation of custom model from Quantity arrays @@ -44,6 +47,7 @@ def test_custom_raw_mag_model(): assert len(ext.transmission) > 0 +@pytest.mark.remote_data def test_custom_linear_model(): """ Test creation of custom model from Quantity arrays @@ -55,6 +59,7 @@ def test_custom_linear_model(): assert len(ext.transmission) > 0 +@pytest.mark.remote_data def test_missing_extinction_unit(): """ Test creation of custom model from Quantity arrays @@ -68,6 +73,7 @@ def test_missing_extinction_unit(): assert len(ext.transmission) > 0 +@pytest.mark.remote_data def test_transmission_model(): """ Test creating of default atmospheric transmission model diff --git a/specreduce/tests/test_get_reference_file_path.py b/specreduce/tests/test_get_reference_file_path.py index ffb7d79b..bea0d823 100644 --- a/specreduce/tests/test_get_reference_file_path.py +++ b/specreduce/tests/test_get_reference_file_path.py @@ -1,6 +1,9 @@ +import pytest + from ..calibration_data import get_reference_file_path, get_pypeit_data_path +@pytest.mark.remote_data def test_get_reference_file_path(): """ Test to make sure a calibration reference file provided by specreduce_data can be accessed. @@ -10,6 +13,7 @@ def test_get_reference_file_path(): assert p is not None +@pytest.mark.remote_data def test_get_pypeit_data_path(): """ Test to make sure pypeit reference data can be loaded diff --git a/specreduce/tests/test_linelists.py b/specreduce/tests/test_linelists.py index 011f0c76..61e1ca45 100644 --- a/specreduce/tests/test_linelists.py +++ b/specreduce/tests/test_linelists.py @@ -3,6 +3,7 @@ from ..calibration_data import load_pypeit_calibration_lines +@pytest.mark.remote_data def test_pypeit_single(): """ Test to load a single linelist from ``pypeit`` by passing a string. @@ -21,6 +22,7 @@ def test_pypeit_single(): ] +@pytest.mark.remote_data def test_pypeit_list(): """ Test to load and combine a set of linelists from ``pypeit`` by passing a list. @@ -32,6 +34,7 @@ def test_pypeit_list(): assert "NeI" in line_tab['ion'] +@pytest.mark.remote_data def test_pypeit_empty(): """ Test to make sure None is returned if an empty list is passed. @@ -42,6 +45,7 @@ def test_pypeit_empty(): assert 'No calibration lines' in record[0].message.args[0] +@pytest.mark.remote_data def test_pypeit_input_validation(): """ Check that bad inputs for ``pypeit`` linelists raise the appropriate warnings and exceptions diff --git a/specreduce/tests/test_specphot_stds.py b/specreduce/tests/test_specphot_stds.py index ef251a03..868315ba 100644 --- a/specreduce/tests/test_specphot_stds.py +++ b/specreduce/tests/test_specphot_stds.py @@ -1,15 +1,19 @@ +import pytest + from ..calibration_data import ( load_MAST_calspec, load_onedstds ) +@pytest.mark.remote_data def test_load_MAST(): sp = load_MAST_calspec("g191b2b_005.fits", show_progress=False) assert sp is not None assert len(sp.spectral_axis) > 0 +@pytest.mark.remote_data def test_load_onedstds(): sp = load_onedstds() assert sp is not None diff --git a/specreduce/tests/test_synth_data.py b/specreduce/tests/test_synth_data.py index e2817ec3..276be972 100644 --- a/specreduce/tests/test_synth_data.py +++ b/specreduce/tests/test_synth_data.py @@ -22,12 +22,14 @@ def test_make_2d_trace_image(): assert isinstance(ccdim, CCDData) +@pytest.mark.remote_data @pytest.mark.filterwarnings("ignore:No observer defined on WCS") def test_make_2d_arc_image_defaults(): ccdim = make_2d_arc_image() assert isinstance(ccdim, CCDData) +@pytest.mark.remote_data @pytest.mark.filterwarnings("ignore:No observer defined on WCS") def test_make_2d_arc_pass_wcs(): nx = 3000 @@ -179,6 +181,7 @@ def test_make_2d_arc_pass_wcs(): ) +@pytest.mark.remote_data @pytest.mark.filterwarnings("ignore:No observer defined on WCS") def test_make_2d_spec_image_defaults(): ccdim = make_2d_spec_image()