def test_fnpickling_class(tmpdir):
 fn = str(tmpdir.join('test2.pickle'))
 obj1 = 'astring'
 obj2 = ToBePickled(obj1)
 fnpickle(obj2, fn)
 res = fnunpickle(fn)
 assert (res == obj2)

def test_fnpickling_class ( tmpdir ) : fn = str ( tmpdir . join ( 'test2.pickle' ) ) obj1 = 'astring' obj2 = ToBePickled ( obj1 ) fnpickle ( obj2 , fn ) res = fnunpickle ( fn ) assert ( res == obj2 )
tests the fnpickle and fnupickle functions ability to pickle and unpickle custom classes .