diff --git a/asdf/_tests/tags/core/tests/test_integer.py b/asdf/_tests/tags/core/tests/test_integer.py index e27203abb..82f5fa13b 100644 --- a/asdf/_tests/tags/core/tests/test_integer.py +++ b/asdf/_tests/tags/core/tests/test_integer.py @@ -46,7 +46,7 @@ def test_integer_storage(tmpdir, inline): with asdf.AsdfFile(tree) as af: af.write_to(tmpfile) - tree = asdf.util.load_yaml(tmpfile, as_tagged=True) + tree = asdf.util.load_yaml(tmpfile, tagged=True) if inline: assert "source" not in tree["integer"]["words"] assert "data" in tree["integer"]["words"] diff --git a/asdf/_tests/test_util.py b/asdf/_tests/test_util.py index 6af71a532..e1800cf5d 100644 --- a/asdf/_tests/test_util.py +++ b/asdf/_tests/test_util.py @@ -122,8 +122,8 @@ def test_minversion(): @pytest.mark.parametrize("input_type", ["filename", "binary_file", "generic_file"]) -@pytest.mark.parametrize("as_tagged", [True, False]) -def test_load_yaml(tmp_path, input_type, as_tagged): +@pytest.mark.parametrize("tagged", [True, False]) +def test_load_yaml(tmp_path, input_type, tagged): fn = tmp_path / "test.asdf" asdf.AsdfFile({"a": np.zeros(3)}).write_to(fn) @@ -138,8 +138,8 @@ def test_load_yaml(tmp_path, input_type, as_tagged): ctx = init with ctx: - tree = util.load_yaml(init, as_tagged=as_tagged) - if as_tagged: + tree = util.load_yaml(init, tagged=tagged) + if tagged: assert isinstance(tree["a"], asdf.tagged.TaggedDict) else: assert not isinstance(tree["a"], asdf.tagged.TaggedDict) diff --git a/asdf/util.py b/asdf/util.py index 51d4bc81e..75bd07bf5 100644 --- a/asdf/util.py +++ b/asdf/util.py @@ -58,7 +58,7 @@ ] -def load_yaml(init, as_tagged=False): +def load_yaml(init, tagged=False): """ Load just the yaml portion of an ASDF file @@ -68,7 +68,7 @@ def load_yaml(init, as_tagged=False): init : filename or file-like If file-like this must be opened in binary mode. - as_tagged: bool, optional + tagged: bool, optional Return tree with instances of `asdf.tagged.Tagged` this can be helpful if the yaml tags are of interest. If False, the tree will only contain basic python types @@ -84,7 +84,7 @@ def load_yaml(init, as_tagged=False): from .generic_io import get_file from .yamlutil import AsdfLoader - if as_tagged: + if tagged: loader = AsdfLoader else: loader = yaml.CBaseLoader if getattr(yaml, "__with_libyaml__", None) else yaml.BaseLoader