#NEWLINE# def test_round_trip_current( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# import cPickle as c_pickle #NEWLINE# def c_pickler( obj , path ) : #NEWLINE# #INDENT# with open ( path , 'wb' ) as fh : #NEWLINE# #INDENT# c_pickle . dump ( obj , fh , protocol = ( - 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# def c_unpickler( path ) : #NEWLINE# #INDENT# with open ( path , 'rb' ) as fh : #NEWLINE# #INDENT# fh . seek ( 0 ) #NEWLINE# return c_pickle . load ( fh ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# c_pickler = None #NEWLINE# c_unpickler = None #NEWLINE# #UNINDENT# import pickle as python_pickle #NEWLINE# def python_pickler( obj , path ) : #NEWLINE# #INDENT# with open ( path , 'wb' ) as fh : #NEWLINE# #INDENT# python_pickle . dump ( obj , fh , protocol = ( - 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# def python_unpickler( path ) : #NEWLINE# #INDENT# with open ( path , 'rb' ) as fh : #NEWLINE# #INDENT# fh . seek ( 0 ) #NEWLINE# return python_pickle . load ( fh ) #NEWLINE# #UNINDENT# #UNINDENT# for ( typ , dv ) in self . data . items ( ) : #NEWLINE# #INDENT# for ( dt , expected ) in dv . items ( ) : #NEWLINE# #INDENT# for writer in [ pd . to_pickle , c_pickler , python_pickler ] : #NEWLINE# #INDENT# if ( writer is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# with tm . ensure_clean ( self . path ) as path : #NEWLINE# #INDENT# writer ( expected , path ) #NEWLINE# result = pd . read_pickle ( path ) #NEWLINE# self . compare_element ( result , expected , typ ) #NEWLINE# if ( c_unpickler is not None ) : #NEWLINE# #INDENT# result = c_unpickler ( path ) #NEWLINE# self . compare_element ( result , expected , typ ) #NEWLINE# #UNINDENT# result = python_unpickler ( path ) #NEWLINE# self . compare_element ( result , expected , typ )