diff --git a/pandas/tests/io/test_pickle.py b/pandas/tests/io/test_pickle.py index 42f904b47a6ee..ccd77f47b5e5e 100644 --- a/pandas/tests/io/test_pickle.py +++ b/pandas/tests/io/test_pickle.py @@ -381,10 +381,10 @@ def test_read(self, protocol, get_random_path): tm.assert_frame_equal(df, df2) -def test_unicode_decode_error(): +def test_unicode_decode_error(datapath): # pickle file written with py27, should be readable without raising # UnicodeDecodeError, see GH#28645 - path = os.path.join(os.path.dirname(__file__), "data", "pickle", "test_py27.pkl") + path = datapath("io", "data", "pickle", "test_py27.pkl") df = pd.read_pickle(path) # just test the columns are correct since the values are random