Skip to content

Commit

Permalink
Merge pull request #1729 from braingram/pytest_8_warnings
Browse files Browse the repository at this point in the history
update test warning filter for pytest 8
  • Loading branch information
braingram authored Jan 22, 2024
2 parents c0eae06 + f2cb270 commit 198b9ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
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

0 comments on commit 198b9ed

Please sign in to comment.