Skip to content

Commit

Permalink
test: ensure typetracer isn't seen by users
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Dec 2, 2022
1 parent 8cc3e43 commit 6a6eb9b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_1940-ak-backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE

import numpy as np # noqa: F401
import pytest # noqa: F401

import awkward as ak


def test_typetracer():
array = ak.Array([[0, 1, 2, 3], [8, 9, 10, 11]])
typetracer = ak.Array(array.layout.typetracer)

with pytest.raises(ValueError, match="internal backend"):
ak.backend(typetracer)


def test_typetracer_mixed():
array = ak.Array([[0, 1, 2, 3], [8, 9, 10, 11]])
typetracer = ak.Array(array.layout.typetracer)

with pytest.raises(ValueError, match="internal backend"):
ak.backend(typetracer, array)

0 comments on commit 6a6eb9b

Please sign in to comment.