Skip to content

Commit

Permalink
Merge pull request #247 from lpsinger/warnings-as-errors
Browse files Browse the repository at this point in the history
Treat warnings in unit tests as errors
  • Loading branch information
pllim authored Feb 27, 2025
2 parents 7b51753 + 46857f5 commit 41d0091
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions astropy_healpix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ def parse_input_healpix_data(input_data, field=0, hdu_in=None, nested=None):
if 'ORDERING' in header:
nested = header['ORDERING'].lower() == 'nested'
elif isinstance(input_data, str):
hdu = fits.open(input_data)[hdu_in or 1]
return parse_input_healpix_data(hdu, field=field)
with fits.open(input_data) as hdus:
hdu = hdus[hdu_in or 1]
return parse_input_healpix_data(hdu, field=field)
elif isinstance(input_data, tuple) and isinstance(input_data[0], np.ndarray):
array_in = input_data[0]
coordinate_system_in = parse_coord_system(input_data[1])
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
skip = "pp*"

[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore:numpy\\.ndarray size changed:RuntimeWarning",
]

0 comments on commit 41d0091

Please sign in to comment.