From 62acb1a8e81cad4be14f6c5478e2b281814558a2 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 8 Jan 2024 14:19:10 -0500 Subject: [PATCH 1/3] update test warning filter for pytest 8 --- asdf/_tests/test_deprecated.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/asdf/_tests/test_deprecated.py b/asdf/_tests/test_deprecated.py index 5a749d291..ecea532f5 100644 --- a/asdf/_tests/test_deprecated.py +++ b/asdf/_tests/test_deprecated.py @@ -1,4 +1,5 @@ import sys +import warnings import numpy as np import pytest @@ -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(): From 2452abb7ecc5b44e5ae07195621829e93bb36430 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 17 Jan 2024 17:14:30 -0500 Subject: [PATCH 2/3] add pytest pre to requirements-dev.txt --- requirements-dev.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index a552322cc..dbc6e49ec 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,6 +5,8 @@ git+https://github.com/asdf-format/asdf-unit-schemas.git git+https://github.com/asdf-format/asdf-wcs-schemas git+https://github.com/yaml/pyyaml.git +pytest>=0.0.dev0 + numpy>=0.0.dev0 # although we don't use scipy, we include it here so that any dependency # that uses it during these tests will use the development version From f2cb270861dadb03e46b8f68d719c0ea8911f9c0 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 22 Jan 2024 14:27:59 -0500 Subject: [PATCH 3/3] switch pytestdev tests to tox factor --- .github/workflows/ci.yml | 2 ++ requirements-dev.txt | 2 -- tox.ini | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f52557cb..5e0199b8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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] diff --git a/requirements-dev.txt b/requirements-dev.txt index dbc6e49ec..a552322cc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,8 +5,6 @@ git+https://github.com/asdf-format/asdf-unit-schemas.git git+https://github.com/asdf-format/asdf-wcs-schemas git+https://github.com/yaml/pyyaml.git -pytest>=0.0.dev0 - numpy>=0.0.dev0 # although we don't use scipy, we include it here so that any dependency # that uses it during these tests will use the development version diff --git a/tox.ini b/tox.ini index c741492ad..16c8bafa3 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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