diff --git a/asdf/_tests/test_lazy_nodes.py b/asdf/_tests/test_lazy_nodes.py index 77ff5bcfb..b97f91b11 100644 --- a/asdf/_tests/test_lazy_nodes.py +++ b/asdf/_tests/test_lazy_nodes.py @@ -1,5 +1,6 @@ import collections import copy +import json import weakref import numpy as np @@ -110,6 +111,19 @@ def test_copy(node, copy_operation): assert copied_node == node +@pytest.mark.parametrize( + "node", + [ + _lazy_nodes.AsdfDictNode({"a": 1, "b": 2}), + _lazy_nodes.AsdfListNode([1, 2, 3]), + _lazy_nodes.AsdfOrderedDictNode({"a": 1, "b": 2}), + ], +) +def test_json_serialization(node): + with pytest.raises(TypeError, match="is not JSON serializable"): + json.dumps(node) + + def test_cache_clear_on_close(tmp_path): fn = tmp_path / "test.asdf"