From e4e0432a325104bb8d2e91e342117e23f5cbd690 Mon Sep 17 00:00:00 2001 From: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com> Date: Sun, 4 Sep 2022 21:07:55 +0200 Subject: [PATCH] TST: add tests for parser functions being pickle-able. --- pandas/tests/io/test_common.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index e9e99f6dd0ad7..3f95dd616a09c 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -12,6 +12,7 @@ import mmap import os from pathlib import Path +import pickle import tempfile import pytest @@ -604,3 +605,23 @@ def close(self): with BytesIO() as buffer: with icom.get_handle(buffer, "rb") as handles: handles.created_handles.append(TestError()) + + +@pytest.mark.parametrize( + "reader", + [ + pd.read_csv, + pd.read_fwf, + pd.read_excel, + pd.read_feather, + pd.read_hdf, + pd.read_stata, + pd.read_sas, + pd.read_json, + pd.read_pickle, + ], +) +def test_pickle_reader(reader): + # GH 22265 + with BytesIO() as buffer: + pickle.dump(reader, buffer)