astropy.tests.helper.
check_pickling_recovery
Try to pickle an object. If successful, make sure the object’s attributes survived pickling and unpickling.