Skip to content

Commit

Permalink
Merge pull request #211 from mwcraig/restrict-remote-data
Browse files Browse the repository at this point in the history
Restrict remote data to only one test
  • Loading branch information
mwcraig authored Dec 13, 2023
2 parents 78bc8bf + 5e9b959 commit c11cd69
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ norecursedirs = [
astropy_header = true
doctest_plus = "enabled"
text_file_format = "rst"
remote_data_strict = true
addopts = [
"-ra",
"--color=yes",
Expand Down
20 changes: 8 additions & 12 deletions stellarphot/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
1 change: 1 addition & 0 deletions stellarphot/io/tests/test_tess_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions stellarphot/utils/tests/test_catalog_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')])
Expand All @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c11cd69

Please sign in to comment.