def test_bool(self, value): with pytest.raises(TypeError): internal.get_size(value) with pytest.raises(TypeError): internal.get_size((value, value))
def test_float(self): # `internal.get_size` is not responsible to interpret values as # integers. assert internal.get_size(1.0) == (1.0, )
def test_numpy_zero_dim_ndarray(self): assert internal.get_size(numpy.array(1)) == (1, )
def test_tuple_of_numpy_scalars(self): assert internal.get_size((numpy.int32(1), numpy.array(1))) == (1, 1)
def test_numpy_int(self): assert internal.get_size(numpy.int32(1)) == (1, )
def test_int(self): assert internal.get_size(1) == (1, )
def check_collection(self, a): assert internal.get_size(a) == tuple(a)
def test_none(self): with testing.assert_warns(DeprecationWarning): assert internal.get_size(None) == ()
def test_float(self): with pytest.raises(ValueError): internal.get_size(1.0)