diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45645558..a5199fa5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,14 +15,17 @@ jobs: python-version: ["3.10","3.11"] platform: [ubuntu-latest, macos-latest, windows-latest] exclude: - # This case is handled in the coverage run + # This case is handled in the coverage/remote data run - python-version: "3.11" platform: ubuntu-latest include: # In the run on python 3.11 on ubuntu include running coverage + # and remote data. Do both tests together to get best coverage + # estimate. - python-version: "3.11" platform: ubuntu-latest coverage: true + toxposargs: --remote-data=any runs-on: ${{ matrix.platform }} diff --git a/pyproject.toml b/pyproject.toml index d724db2d..048faca1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ norecursedirs = [ astropy_header = true doctest_plus = "enabled" text_file_format = "rst" +remote_data_strict = true addopts = [ "-ra", "--color=yes", diff --git a/stellarphot/conftest.py b/stellarphot/conftest.py index faacf46b..b34d0664 100644 --- a/stellarphot/conftest.py +++ b/stellarphot/conftest.py @@ -6,6 +6,10 @@ def pytest_configure(config): + from astropy.utils.iers import conf as iers_conf + + # Disable IERS auto download for testing + iers_conf.auto_download = False config.option.astropy_header = True PYTEST_HEADER_MODULES.pop('h5py', None) @@ -15,16 +19,8 @@ def pytest_configure(config): TESTED_VERSIONS[packagename] = version -# from astropy.tests.helper import enable_deprecations_as_exceptions +def pytest_unconfigure(config): + from astropy.utils.iers import conf as iers_conf -## Uncomment the following line to treat all DeprecationWarnings as -## exceptions. For Astropy v2.0 or later, there are 2 additional keywords, -## as follow (although default should work for most cases). -## To ignore some packages that produce deprecation warnings on import -## (in addition to 'compiler', 'scipy', 'pygments', 'ipykernel', and -## 'setuptools'), add: -## modules_to_ignore_on_import=['module_1', 'module_2'] -## To ignore some specific deprecation warning messages for Python version -## MAJOR.MINOR or later, add: -## warnings_to_ignore_by_pyver={(MAJOR, MINOR): ['Message to ignore']} -# enable_deprecations_as_exceptions() + # Undo IERS auto download setting for testing + iers_conf.reset("auto_download") diff --git a/stellarphot/io/tests/test_tess_submission.py b/stellarphot/io/tests/test_tess_submission.py index 888f0f36..afb1233a 100644 --- a/stellarphot/io/tests/test_tess_submission.py +++ b/stellarphot/io/tests/test_tess_submission.py @@ -73,6 +73,7 @@ def test_valid_method(): assert not tsub._valid() +@pytest.mark.remote_data def test_target_file(): # Getting the target information failed on windows, so the # first point of this test is to simply succeed in creating the diff --git a/stellarphot/utils/tests/test_catalog_search.py b/stellarphot/utils/tests/test_catalog_search.py index 4f8b39fe..35386d31 100644 --- a/stellarphot/utils/tests/test_catalog_search.py +++ b/stellarphot/utils/tests/test_catalog_search.py @@ -129,6 +129,7 @@ def test_in_frame(): assert in_out[1] +@pytest.mark.remote_data @pytest.mark.parametrize('clip, data_file', [(True, 'data/clipped_ey_uma_vsx.fits'), (False, 'data/unclipped_ey_uma_vsx.fits')]) @@ -153,6 +154,7 @@ def test_catalog_search(clip, data_file): assert all(actual['OID'] == expected['OID']) +@pytest.mark.remote_data def test_find_known_variables(): # Under the hood this calls catalog search on the VSX # catalog and clips to the frame. @@ -175,6 +177,7 @@ def test_find_known_variables(): assert expected['Name'] == vsx['Name'] +@pytest.mark.remote_data def test_catalog_search_from_wcs_or_coord(): data_file = 'data/sample_wcs_ey_uma.fits' data = get_pkg_data_filename(data_file) @@ -221,6 +224,7 @@ def test_catalog_search_with_coord_and_frame_clip_fails(): assert 'To clip entries by frame' in str(e.value) +@pytest.mark.remote_data def test_find_apass(): # This is really checking from APASS DR9 on Vizier, or at least that # is where the "expected" data is drawn from.