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 Feb 27, 2024
1 parent 5678f07 commit a920a68
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 @@ -287,6 +287,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 @@ -301,7 +302,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 @@ -331,6 +333,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 @@ -348,7 +351,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 a920a68

Please sign in to comment.