Skip to content

Commit

Permalink
Test for 0 dimensional numpy array (failing)
Browse files Browse the repository at this point in the history
  • Loading branch information
catherio committed Jan 16, 2025
1 parent 1c7e812 commit 636252d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ def test_numpy_array_unsupported_dtype(self):
orjson.dumps(array, option=orjson.OPT_SERIALIZE_NUMPY)
assert "unsupported datatype in numpy array" in str(cm)

def test_numpy_array_d0(self):
array = numpy.array(1)
assert (
orjson.loads(
orjson.dumps(
array,
option=orjson.OPT_SERIALIZE_NUMPY,
)
)
== 1
)

def test_numpy_array_d1(self):
array = numpy.array([1])
assert (
Expand Down

0 comments on commit 636252d

Please sign in to comment.