My function looks like this
import pandas as pd
def my_function( file_path ):
df = pd.read_csv( filepath )
#some other operations on df here
return df
I do not want to access an external file for unit test. Is there any way to create a csv file like object on the fly for unit testing.