From a86bf566594278e1ea135ec419832e8fc100dccf Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Fri, 26 Jan 2024 17:37:03 -0600 Subject: [PATCH] add tests to check assigning behaviors/attrs after array creation fails --- tests/test_core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_core.py b/tests/test_core.py index bcb98efc..1dfff3fc 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -886,3 +886,13 @@ def test_shape_only_ops(fn: Callable, tmp_path_factory: pytest.TempPathFactory) result = fn(lazy.b) # type: ignore with dask.config.set({"awkward.optimization.enabled": True}): result.compute() + + +def test_assign_behavior(daa_p1: dak.Array) -> None: + with pytest.raises(TypeError, match="'mappingproxy' object does not support item assignment"): + daa_p1.behavior["should_fail"] = None + + +def test_assign_attrs(daa_p1: dak.Array) -> None: + with pytest.raises(TypeError, match="'mappingproxy' object does not support item assignment"): + daa_p1.attrs["should_fail"] = None