Skip to content

Commit

Permalink
Merge pull request #1440 from braingram/deprecate/tests_helpers
Browse files Browse the repository at this point in the history
deprecate asdf.tests.helpers
  • Loading branch information
braingram authored Feb 23, 2023
2 parents effb92a + f8bc027 commit 81ab02d
Show file tree
Hide file tree
Showing 35 changed files with 569 additions and 520 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The ASDF Standard is at v1.6.0
- move asdf.types.format_tag to asdf.testing.helpers.format_tag [#1433]
- Deprecate AsdfExtenion, AsdfExtensionList, BuiltinExtension [#1429]
- Add AsdfDeprecationWarning to asdf_extensions entry point [#1361]
- Deprecate asdf.tests.helpers [#1440]

2.14.3 (2022-12-15)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_defragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import asdf
from asdf import AsdfFile
from asdf.commands import main
from asdf.tests.helpers import assert_tree_match, get_file_sizes
from asdf.tests._helpers import assert_tree_match, get_file_sizes


def _test_defragment(tmpdir, codec):
Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

from asdf.commands import diff, main
from asdf.tests import helpers
from asdf.tests import _helpers as helpers

from . import data as test_data

Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_exploded.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import asdf
from asdf import AsdfFile
from asdf.commands import main
from asdf.tests.helpers import assert_tree_match, get_file_sizes
from asdf.tests._helpers import assert_tree_match, get_file_sizes


def test_explode_then_implode(tmpdir):
Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
del sys.modules["asdf.fits_embed"]
import asdf.fits_embed

from asdf.tests.helpers import assert_tree_match
from asdf.tests._helpers import assert_tree_match


def test_extract(tmpdir):
Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from asdf.commands import main
from asdf.tests import helpers
from asdf.tests import _helpers as helpers

from . import data as test_data

Expand Down
2 changes: 1 addition & 1 deletion asdf/commands/tests/test_to_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import asdf
from asdf import AsdfFile
from asdf.commands import main
from asdf.tests.helpers import assert_tree_match, get_file_sizes
from asdf.tests._helpers import assert_tree_match, get_file_sizes


def test_to_yaml(tmpdir):
Expand Down
2 changes: 1 addition & 1 deletion asdf/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from asdf.tests.httpserver import HTTPServer, RangeHTTPServer

collect_ignore = ["asdftypes.py", "fits_embed.py", "resolver.py", "type_index.py", "types.py"]
collect_ignore = ["asdftypes.py", "fits_embed.py", "resolver.py", "type_index.py", "types.py", "tests/helpers.py"]


@pytest.fixture()
Expand Down
6 changes: 5 additions & 1 deletion asdf/entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@ def _handle_error(e):
category=AsdfDeprecationWarning,
message="BuiltinExtension is deprecated",
)
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message="asdf.tests.helpers is deprecated",
)
elif entry_point.name != "builtin":
warnings.warn(
f"{package_name} uses the deprecated entry point {LEGACY_EXTENSIONS_GROUP}. "
f"Please use the new extension api and entry point {EXTENSIONS_GROUP}: "
"https://asdf.readthedocs.io/en/stable/asdf/extending/extensions.html",
AsdfDeprecationWarning,
)

elements = entry_point.load()()

except Exception as e: # noqa: BLE001
Expand Down
2 changes: 1 addition & 1 deletion asdf/tags/core/tests/test_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

import asdf
from asdf.tests import helpers
from asdf.tests import _helpers as helpers


def make_complex_asdf(string):
Expand Down
2 changes: 1 addition & 1 deletion asdf/tags/core/tests/test_extension_metadata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asdf
from asdf.tests import helpers
from asdf.tests import _helpers as helpers


def test_extra_properties():
Expand Down
2 changes: 1 addition & 1 deletion asdf/tags/core/tests/test_external_reference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from asdf.tags.core.external_reference import ExternalArrayReference
from asdf.tests import helpers
from asdf.tests import _helpers as helpers


def test_roundtrip_external_array(tmpdir):
Expand Down
4 changes: 2 additions & 2 deletions asdf/tags/core/tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from asdf import util
from asdf.exceptions import AsdfDeprecationWarning, AsdfWarning
from asdf.tags.core import HistoryEntry
from asdf.tests import helpers
from asdf.tests.helpers import assert_no_warnings, yaml_to_asdf
from asdf.tests import _helpers as helpers
from asdf.tests._helpers import assert_no_warnings, yaml_to_asdf

SCHEMA_PATH = os.path.join(os.path.dirname(helpers.__file__), "data")

Expand Down
2 changes: 1 addition & 1 deletion asdf/tags/core/tests/test_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import asdf
from asdf import IntegerType
from asdf.tests import helpers
from asdf.tests import _helpers as helpers

# Make sure tests are deterministic
random.seed(0)
Expand Down
2 changes: 1 addition & 1 deletion asdf/tags/core/tests/test_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from asdf import util
from asdf.exceptions import AsdfDeprecationWarning
from asdf.tags.core import ndarray
from asdf.tests import helpers
from asdf.tests import _helpers as helpers
from asdf.tests.objects import CustomTestType

from . import data as test_data
Expand Down
Loading

0 comments on commit 81ab02d

Please sign in to comment.