def round_trip_localpath(writer, reader, path=None):
import pytest<EOL>LocalPath = pytest.importorskip('<STR_LIT>').local<EOL>if path is None:<EOL><INDENT>path = '<STR_LIT>'<EOL><DEDENT>with ensure_clean(path) as path:<EOL><INDENT>writer(LocalPath(path))<EOL>obj = reader(LocalPath(path))<EOL><DEDENT>return obj<EOL>
Write an object to file specified by a py.path LocalPath and read it back

Parameters
----------
writer : callable bound to pandas object
    IO writing function (e.g. DataFrame.to_csv )
reader : callable
    IO reading function (e.g. pd.read_csv )
path : str, default None
    The path where the object is written and then read.

Returns
-------
round_trip_object : pandas object
    The original object that was serialized and then re-read.