Skip to content

Commit

Permalink
add tests to check assigning behaviors/attrs after array creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray authored Jan 26, 2024
1 parent a753337 commit a86bf56
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a86bf56

Please sign in to comment.