def test_pkl_yaml_src_field():
 try:
  (fd, fn) = mkstemp()
  close(fd)
  o = DumDum()
  o.x = ('a', 'b', 'c')
  serial.save(fn, o)
  yaml = (("!pkl: '" + fn) + "'\n")
  loaded = load(yaml)
  assert (loaded.x == ('a', 'b', 'c'))
  assert (loaded.yaml_src == yaml)
 finally:
  os.remove(fn)

def test_pkl_yaml_src_field ( ) : try : ( fd , fn ) = mkstemp ( ) close ( fd ) o = DumDum ( ) o . x = ( 'a' , 'b' , 'c' ) serial . save ( fn , o ) yaml = ( ( "!pkl: '" + fn ) + "'\n" ) loaded = load ( yaml ) assert ( loaded . x == ( 'a' , 'b' , 'c' ) ) assert ( loaded . yaml_src == yaml ) finally : os . remove ( fn )
tests a regression where yaml_src wasnt getting correctly set on pkls .