Test: Numpy Scalar Creation (#1530)

I found that the numpy array tests already contained an empty-shaped
array test, but none with data in it.

Following PEP 3118, scalars have an empty shape and ndim 0. This
works already and is now also documented/covered by a test.
This commit is contained in:
Axel Huebl
2019-06-11 14:00:05 +02:00
committed by Wenzel Jakob
parent 41f29ccd9e
commit 000aabb2a7
2 changed files with 10 additions and 0 deletions

View File

@@ -138,6 +138,11 @@ def test_make_c_f_array():
def test_make_empty_shaped_array():
m.make_empty_shaped_array()
# empty shape means numpy scalar, PEP 3118
assert m.scalar_int().ndim == 0
assert m.scalar_int().shape == ()
assert m.scalar_int() == 42
def test_wrap():
def assert_references(a, b, base=None):