diff --git a/asdf/_asdf.py b/asdf/_asdf.py index f7056ab51..ad9de9223 100644 --- a/asdf/_asdf.py +++ b/asdf/_asdf.py @@ -1623,7 +1623,7 @@ def open_asdf( ignore_unrecognized_tag=False, _force_raw_types=False, copy_arrays=NotSet, - memmap=True, + memmap=NotSet, lazy_tree=NotSet, lazy_load=True, custom_schema=None, diff --git a/asdf/_tests/test_array_blocks.py b/asdf/_tests/test_array_blocks.py index 2efc4d85b..32cb03491 100644 --- a/asdf/_tests/test_array_blocks.py +++ b/asdf/_tests/test_array_blocks.py @@ -816,12 +816,13 @@ def filename_with_array(tmp_path_factory): ({"memmap": False}, False), ({"copy_arrays": True}, False), ({"copy_arrays": False}, True), - ({"memmap": True, "copy_arrays": True}, True), - ({"memmap": True, "copy_arrays": False}, True), - ({"memmap": False, "copy_arrays": True}, False), - ({"memmap": False, "copy_arrays": False}, False), + ({"copy_arrays": True, "memmap": True}, True), + ({"copy_arrays": False, "memmap": True}, True), + ({"copy_arrays": True, "memmap": False}, False), + ({"copy_arrays": False, "memmap": False}, False), ], ) +@pytest.mark.filterwarnings("ignore:copy_arrays is deprecated") def test_open_no_memmap(filename_with_array, open_kwargs, should_memmap): """ Test that asdf.open does not (or does) return memmaps for arrays diff --git a/asdf/_tests/test_deprecated.py b/asdf/_tests/test_deprecated.py index 711c2c9df..55bb02d13 100644 --- a/asdf/_tests/test_deprecated.py +++ b/asdf/_tests/test_deprecated.py @@ -6,7 +6,7 @@ import asdf import asdf.testing.helpers -from asdf.exceptions import AsdfDeprecationWarning, ValidationError +from asdf.exceptions import AsdfDeprecationWarning, AsdfWarning, ValidationError def test_asdf_stream_deprecation(): @@ -155,6 +155,6 @@ def test_copy_arrays_deprecation(copy_arrays, memmap, tmp_path): af = asdf.AsdfFile() af["a"] = 1 af.write_to(fn) - with pytest.warns(AsdfDeprecationWarning, match="copy_arrays is deprecated; use memmap instead"): + with pytest.warns(AsdfWarning, match="copy_arrays is deprecated; use memmap instead"): with asdf.open(fn, copy_arrays=copy_arrays, memmap=memmap) as af: pass