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

remove deprecated tests.helpers #1597

Merged
merged 5 commits into from
Aug 7, 2023
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
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The ASDF Standard is at v1.6.0
- Convert numpy scalars to python types during yaml encoding
to handle NEP51 changes for numpy 2.0 [#1605]
- Vendorize jsonschema 4.17.3 [#1591]
- Remove deprecated tests.helpers [#1597]

2.15.0 (2023-03-28)
-------------------
Expand Down
5 changes: 1 addition & 4 deletions asdf/_tests/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import asdf
from asdf import generic_io, versioning
from asdf._resolver import Resolver, ResolverChain
from asdf.asdf import AsdfFile, get_asdf_library_info
from asdf.block import Block
from asdf.constants import YAML_TAG_PREFIX
Expand Down Expand Up @@ -417,10 +418,6 @@ def assert_extension_correctness(extension):
"""
__tracebackhide__ = True

# locally import the deprecated Resolver and ResolverChain to avoid
# exposing it as asdf.tests.helpers.Resolver/ResolverChain
from asdf._resolver import Resolver, ResolverChain

warnings.warn(
"assert_extension_correctness is deprecated and depends "
"on the deprecated type system. Please use the new "
Expand Down
14 changes: 0 additions & 14 deletions asdf/_tests/test_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

import asdf
Expand Down Expand Up @@ -33,18 +31,6 @@ def test_asdf_type_format_tag():
asdf.testing.helpers.format_tag


def test_asdf_tests_helpers_deprecation():
with pytest.warns(AsdfDeprecationWarning, match="asdf.tests.helpers is deprecated"):
if "asdf.tests.helpers" in sys.modules:
del sys.modules["asdf.tests.helpers"]
import asdf.tests.helpers
from asdf._tests import _helpers

for attr in _helpers.__all__:
with pytest.warns(AsdfDeprecationWarning, match="asdf.tests.helpers is deprecated"):
getattr(asdf.tests.helpers, attr)


def test_blocks_deprecated():
af = asdf.AsdfFile()
with pytest.warns(AsdfDeprecationWarning, match="The property AsdfFile.blocks has been deprecated"):
Expand Down
2 changes: 1 addition & 1 deletion asdf/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# We ignore these files because these modules create deprecation warnings on
# import. When warnings are turned into errors this will completely prevent
# test collection
collect_ignore = ["asdftypes.py", "fits_embed.py", "resolver.py", "type_index.py", "types.py", "tests/helpers.py"]
collect_ignore = ["asdftypes.py", "fits_embed.py", "resolver.py", "type_index.py", "types.py"]
Empty file removed asdf/tests/__init__.py
Empty file.
27 changes: 0 additions & 27 deletions asdf/tests/helpers.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/asdf/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ include adding block storage support to :ref:`converters <extending_converters>`
asdf.tests.helpers Deprecation
==============================

Use of `asdf.tests.helpers` is deprecated. Please see `asdf.testing.helpers`
Use of ``asdf.tests.helpers`` is deprecated. Please see `asdf.testing.helpers`
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that the module has been removed, do we remove its deprecations section? Or change the language to state that it has been "removed"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking we'd leave this for at least 3.X as users migrating from <=2.15 might benefit from not needing to open older docs (2.15) to see what was deprecated/removed. It might end up being redundant if we can put together an exhaustive (but not exhausting) release doc for 3.0.

for alternative functions to aid in testing.
2 changes: 0 additions & 2 deletions docs/asdf/developer_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ to create their own custom ASDF types and extensions.
:no-inheritance-diagram:

.. automodapi:: asdf.testing.helpers

.. automodapi:: asdf.tests.helpers
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ commands_pre =
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest specutils \
-W "ignore::asdf.exceptions.AsdfDeprecationWarning:asdf.tests.helpers"
pytest specutils

[testenv:gwcs]
change_dir = {env_tmp_dir}
Expand Down
Loading