Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey committed Dec 16, 2024
1 parent 0c72f0a commit 113edbe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_3347_weakref_mask_highlevel_array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import annotations

import pytest

import awkward as ak


def test_Array_mask_weakref():
arr = ak.Array([1])
m = arr.mask

assert ak.all(m[[True]] == arr)

del arr
with pytest.raises(
ValueError,
match="The array to mask was deleted before it could be masked. If you want to construct this mask, you must either keep the array alive or use 'ak.mask' explicitly.",
):
_ = m[[True]]

Check failure on line 19 in tests/test_3347_weakref_mask_highlevel_array.py

View workflow job for this annotation

GitHub Actions / Run Tests (pypy3.9, x64, ubuntu-latest, pypy)

test_Array_mask_weakref Failed: DID NOT RAISE <class 'ValueError'>

0 comments on commit 113edbe

Please sign in to comment.