Skip to content
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

update test warning filter for pytest 8 #1729

Merged
merged 3 commits into from
Jan 22, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
- linux: py310-devdeps-parallel
- linux: py311-devdeps-parallel
- linux: py312-devdeps-parallel
# separate pytest so a failure here doesn't cause the whole suite to fail
- linux: py311-pytestdev-parallel

oldest:
needs: [core, asdf-schemas]
Expand Down
16 changes: 14 additions & 2 deletions asdf/_tests/test_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import warnings

import numpy as np
import pytest
Expand All @@ -15,8 +16,19 @@ def test_asdf_stream_deprecation():


def test_asdf_asdf_SerializationContext_import_deprecation():
with pytest.warns(AsdfDeprecationWarning, match="importing SerializationContext from asdf.asdf"):
from asdf.asdf import SerializationContext # noqa: F401
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message="asdf.asdf is deprecated. Please use asdf.AsdfFile and asdf.open",
)
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message="asdf.asdf is deprecated",
)
with pytest.warns(AsdfDeprecationWarning, match="importing SerializationContext from asdf.asdf"):
from asdf.asdf import SerializationContext # noqa: F401


def test_asdf_util_human_list_deprecation():
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
env_list =
compatibility
coverage
py{39,310,311,312}{,-compatibility,-coverage,-jsonschema}{,-devdeps}{,-parallel}
py{39,310,311,312}{,-compatibility,-coverage,-jsonschema}{,-devdeps}{,-parallel}{,-pytestdev}
asdf{-standard,-transform-schemas,-unit-schemas,-wcs-schemas,-coordinates-schemas,-astropy,-zarr,-compression}
astrocut
gwcs
Expand All @@ -24,6 +24,7 @@ deps =
numpydev: cython
oldestdeps: minimum_dependencies
parallel: pytest-xdist
pytestdev: pytest>=0.0.dev0
extras = all,tests
# astropy will complain if the home directory is missing
pass_env = HOME
Expand Down
Loading