def test_len_size():
 t = Time(np.arange(50000, 50010), format='mjd', scale='utc')
 assert ((len(t) == 10) and (t.size == 10))
 t1 = Time(np.arange(50000, 50010).reshape(2, 5), format='mjd', scale='utc')
 assert ((len(t1) == 2) and (t1.size == 10))
 t2 = t[:1]
 assert ((len(t2) == 1) and (t2.size == 1))
 t3 = t[:0]
 assert ((len(t3) == 0) and (t3.size == 0))
 t4 = t[0]
 with pytest.raises(TypeError) as err:
  len(t4)
 assert ('Time' in str(err))

def test_len_size ( ) : t = Time ( np . arange ( 50000 , 50010 ) , format = 'mjd' , scale = 'utc' ) assert ( ( len ( t ) == 10 ) and ( t . size == 10 ) ) t1 = Time ( np . arange ( 50000 , 50010 ) . reshape ( 2 , 5 ) , format = 'mjd' , scale = 'utc' ) assert ( ( len ( t1 ) == 2 ) and ( t1 . size == 10 ) ) t2 = t [ : 1 ] assert ( ( len ( t2 ) == 1 ) and ( t2 . size == 1 ) ) t3 = t [ : 0 ] assert ( ( len ( t3 ) == 0 ) and ( t3 . size == 0 ) ) t4 = t [ 0 ] with pytest . raises ( TypeError ) as err : len ( t4 ) assert ( 'Time' in str ( err ) )
check length of time objects and that scalar ones do not have one .