Skip to content

MAINT: bumping minimum required pytest version and fixes coverage job #3337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions astroquery/casda/tests/test_casda.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
import astropy.units as u
from astropy.table import Table, Column
from astropy.io.votable import parse
from astropy.io.votable.exceptions import W03, W06, W50
from astropy.io.votable.exceptions import W03, W50
from astroquery import log
from astroquery.utils.commons import ASTROPY_LT_5_3
from contextlib import nullcontext

import numpy as np

Expand Down Expand Up @@ -274,10 +272,8 @@ def test_query_region_async_box(patch_get):


def test_filter_out_unreleased():
# The ``W06: Invalid UCD 'meta.ref.url;meta.curation'`` warning is only raised with older astropy
with pytest.warns(W06) if ASTROPY_LT_5_3 else nullcontext():
Comment on lines -277 to -278
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this disappeared with updating the minimum pytest version, but it's gone, and as it was a workaround anyway I don't investigate further.

with pytest.warns(W03):
all_records = parse(data_path('partial_unreleased.xml'), verify='warn').get_first_table().to_table()
with pytest.warns(W03):
all_records = parse(data_path('partial_unreleased.xml'), verify='warn').get_first_table().to_table()
assert all_records[0]['obs_release_date'] == '2017-08-02T03:51:19.728Z'
assert all_records[1]['obs_release_date'] == '2218-01-02T16:51:00.728Z'
assert all_records[2]['obs_release_date'] == ''
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ upload-dir = docs/_build/html
show-response = 1

[tool:pytest]
minversion = 6.0
minversion = 7.4
norecursedirs = build docs/_build astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned astroquery/ibe astroquery/irsa_dust astroquery/cds astroquery/sha astroquery/dace
testpaths = astroquery docs
doctest_plus = enabled
Expand Down Expand Up @@ -89,6 +89,9 @@ filterwarnings =
ignore: The 'strip_cdata' option of HTMLParser:DeprecationWarning
# Triggered in mast, likely boto related
ignore:datetime.datetime.utcnow\(\) is deprecated:DeprecationWarning
# CoverageWarnings triggered by one of the other plugins(?). Either case, explicitely
# ignore it here to have passing test for pytest 8.4.
ignore:Module astroquery was previously imported, but not measured:coverage.exceptions.CoverageWarning

markers =
bigdata: marks tests that are expected to trigger a large download (deselect with '-m "not bigdata"')
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ deps =
oldestdeps: pytest-doctestplus==0.13
oldestdeps: requests==2.25
oldestdeps: keyring==15.0
oldestdeps: pytest==6.0
oldestdeps: pytest==7.4
oldestdeps: beautifulsoup4==4.9
oldestdeps-alldeps: mocpy==0.9
oldestdeps-alldeps: mocpy==0.12
oldestdeps-alldeps: regions==0.5

online: pytest-custom_exit_code
Expand Down
Loading