Skip to content

Commit

Permalink
remove more AsdfExtension references
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed May 2, 2023
1 parent b19d6da commit db393f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
12 changes: 3 additions & 9 deletions asdf/_tests/test_asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ def test_asdf_file_extensions():
af.extensions = arg
assert af.extensions == [ExtensionProxy(extension)]

msg = (
r"[The extensions parameter must be an extension.*, "
r"Extension must implement the Extension or AsdfExtension interface]"
)
msg = r"[The extensions parameter must be an extension.*, Extension must implement the Extension interface]"
for arg in (object(), [object()]):
with pytest.raises(TypeError, match=msg):
AsdfFile(extensions=arg)
Expand Down Expand Up @@ -185,10 +182,7 @@ def test_open_asdf_extensions(tmp_path):
with open_asdf(path, extensions=arg) as af:
assert af.extensions == [ExtensionProxy(extension)]

msg = (
r"[The extensions parameter must be an extension.*, "
r"Extension must implement the Extension or AsdfExtension interface]"
)
msg = r"[The extensions parameter must be an extension.*, Extension must implement the Extension interface]"
for arg in (object(), [object()]):
with pytest.raises(TypeError, match=msg), open_asdf(path, extensions=arg) as af:
pass
Expand All @@ -211,7 +205,7 @@ def test_serialization_context():

assert context.url == context._url == "file://test.asdf"

with pytest.raises(TypeError, match=r"Extension must implement the Extension or AsdfExtension interface"):
with pytest.raises(TypeError, match=r"Extension must implement the Extension interface"):
context._mark_extension_used(object())

with pytest.raises(ValueError, match=r"ASDF Standard version .* is not supported by asdf==.*"):
Expand Down
2 changes: 1 addition & 1 deletion asdf/_tests/test_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_get_extensions(mock_entry_points):
)
with pytest.warns(
AsdfWarning,
match=r"TypeError: Extension must implement the Extension or AsdfExtension interface",
match=r"TypeError: Extension must implement the Extension interface",
):
extensions = entry_points.get_extensions()
assert len(extensions) == 2
Expand Down
4 changes: 2 additions & 2 deletions asdf/_tests/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_extension_proxy_maybe_wrap():
assert proxy.delegate is extension
assert ExtensionProxy.maybe_wrap(proxy) is proxy

with pytest.raises(TypeError, match=r"Extension must implement the Extension or AsdfExtension interface"):
with pytest.raises(TypeError, match=r"Extension must implement the Extension interface"):
ExtensionProxy.maybe_wrap(object())


Expand Down Expand Up @@ -241,7 +241,7 @@ def test_extension_proxy():
assert proxy.class_name == "asdf._tests.test_extension.FullExtension"

# Should fail when the input is not one of the two extension interfaces:
with pytest.raises(TypeError, match=r"Extension must implement the Extension or AsdfExtension interface"):
with pytest.raises(TypeError, match=r"Extension must implement the Extension interface"):
ExtensionProxy(object)

# Should fail with a bad converter:
Expand Down
2 changes: 1 addition & 1 deletion asdf/extension/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def maybe_wrap(cls, delegate):

def __init__(self, delegate, package_name=None, package_version=None):
if not isinstance(delegate, (Extension, _AsdfExtension)):
msg = "Extension must implement the Extension or AsdfExtension interface"
msg = "Extension must implement the Extension interface"
raise TypeError(msg)

self._delegate = delegate
Expand Down
2 changes: 1 addition & 1 deletion asdf/extension/_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_cached_extension_manager(extensions):
Parameters
----------
extensions : list of asdf.extension.AsdfExtension or asdf.extension.Extension
extensions : list of asdf.extension.Extension
Returns
-------
Expand Down

0 comments on commit db393f4

Please sign in to comment.