def test_replace_update_column_via_setitem_warnings_slice():
 t = table.Table([[1, 2, 3], [4, 5, 6]], names=['a', 'b'])
 with catch_warnings() as w:
  with table.conf.set_temp('replace_warnings', ['refcount', 'attributes', 'slice']):
   t2 = t[:2]
   t2['a'] = 0
   assert np.all((t['a'] == [0, 0, 3]))
   assert (len(w) == 0)
   t2['a'] = [10, 20]
   assert (len(w) == 1)
   assert ("replaced column 'a' which looks like an array slice" in str(w[0].message))

def test_replace_update_column_via_setitem_warnings_slice ( ) : t = table . Table ( [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] ] , names = [ 'a' , 'b' ] ) with catch_warnings ( ) as w : with table . conf . set_temp ( 'replace_warnings' , [ 'refcount' , 'attributes' , 'slice' ] ) : t2 = t [ : 2 ] t2 [ 'a' ] = 0 assert np . all ( ( t [ 'a' ] == [ 0 , 0 , 3 ] ) ) assert ( len ( w ) == 0 ) t2 [ 'a' ] = [ 10 , 20 ] assert ( len ( w ) == 1 ) assert ( "replaced column 'a' which looks like an array slice" in str ( w [ 0 ] . message ) )
test warnings related to table replace change in #5556: replace a slice .