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