def test_info_preserved_pickle_copy_init(mixin_cols):
 def pickle_roundtrip(c):
  return pickle.loads(pickle.dumps(c))
 def init_from_class(c):
  return c.__class__(c)
 attrs = ('name', 'unit', 'dtype', 'format', 'description', 'meta')
 for colname in ('i', 'm'):
  m = mixin_cols[colname]
  m.info.name = colname
  m.info.format = '{0}'
  m.info.description = 'd'
  m.info.meta = {'a': 1}
  for func in (copy.copy, copy.deepcopy, pickle_roundtrip, init_from_class):
   m2 = func(m)
   for attr in attrs:
    assert (getattr(m2.info, attr) == getattr(m.info, attr))

def test_info_preserved_pickle_copy_init ( mixin_cols ) : def pickle_roundtrip ( c ) : return pickle . loads ( pickle . dumps ( c ) ) def init_from_class ( c ) : return c . __class__ ( c ) attrs = ( 'name' , 'unit' , 'dtype' , 'format' , 'description' , 'meta' ) for colname in ( 'i' , 'm' ) : m = mixin_cols [ colname ] m . info . name = colname m . info . format = '{0}' m . info . description = 'd' m . info . meta = { 'a' : 1 } for func in ( copy . copy , copy . deepcopy , pickle_roundtrip , init_from_class ) : m2 = func ( m ) for attr in attrs : assert ( getattr ( m2 . info , attr ) == getattr ( m . info , attr ) )
test copy .