Skip to content

Commit

Permalink
expand test to cover not-installed manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed May 7, 2024
1 parent 4087246 commit 15868bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions asdf/_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def test_open_pathlib_path(tmp_path):
@pytest.mark.parametrize(
("installed", "extension", "warns"),
[
(None, "2.0.0", True),
("1.2.3", "2.0.0", True),
("1.2.3", "2.0.dev10842", True),
("2.0.0", "2.0.0", False),
Expand All @@ -299,7 +300,8 @@ class FooExtension:
proxy = ExtensionProxy(FooExtension(), package_name="foo", package_version=installed)

with config_context() as config:
config.add_extension(proxy)
if installed is not None:
config.add_extension(proxy)
af = asdf.AsdfFile()

af._fname = "test.asdf"
Expand Down Expand Up @@ -329,6 +331,7 @@ class FooExtension:
@pytest.mark.parametrize(
("installed", "extension", "warns"),
[
(None, "2.0.0", True),
("1.2.3", "2.0.0", True),
("1.2.3", "2.0.dev10842", True),
("2.0.0", "2.0.0", False),
Expand All @@ -346,7 +349,8 @@ class FooExtension:

with config_context() as config:
config.add_extension(proxy)
config.add_resource_mapping(mapping)
if installed is not None:
config.add_resource_mapping(mapping)
af = asdf.AsdfFile()

af._fname = "test.asdf"
Expand Down

0 comments on commit 15868bb

Please sign in to comment.