Skip to content

Commit

Permalink
update test warning filter for pytest 8
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 8, 2024
1 parent 334f6c3 commit c1818f2
Showing 1 changed file with 14 additions and 2 deletions.
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

0 comments on commit c1818f2

Please sign in to comment.