Skip to content

Commit

Permalink
More zero-dimensional array tests
Browse files Browse the repository at this point in the history
  • Loading branch information
catherio committed Jan 16, 2025
1 parent 5f2ff65 commit b84b472
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/test_numpy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


from datetime import datetime
import sys

import pytest
Expand Down Expand Up @@ -473,16 +474,18 @@ def test_numpy_array_unsupported_dtype(self):
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,
for item in [1, 3.1, False]:
print(item)
array = numpy.array(item)
assert (
orjson.loads(
orjson.dumps(
array,
option=orjson.OPT_SERIALIZE_NUMPY,
)
)
== item
)
== 1
)

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

0 comments on commit b84b472

Please sign in to comment.