From: Thomas Li Date: Sun, 13 Nov 2022 10:36:51 +0000 (+0000) Subject: fix tests to work with newer version of python3-fsspec X-Git-Tag: archive/raspbian/1.5.3+dfsg-2+rpi1~1^2^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9ff6b4f9a33adbe04a8d991c4b0903890dc8259f;p=pandas.git fix tests to work with newer version of python3-fsspec Origin: upstream, https://github.com/pandas-dev/pandas/pull/43849 Last-Update: 2022-02-16 Gbp-Pq: Name fsspec2022_compat.patch --- diff --git a/pandas/tests/io/test_fsspec.py b/pandas/tests/io/test_fsspec.py index 7ce28958..b13c679f 100644 --- a/pandas/tests/io/test_fsspec.py +++ b/pandas/tests/io/test_fsspec.py @@ -38,9 +38,8 @@ def cleared_fs(): def test_read_csv(cleared_fs): - from fsspec.implementations.memory import MemoryFile - - cleared_fs.store["test/test.csv"] = MemoryFile(data=text) + with cleared_fs.open("test/test.csv", "wb") as w: + w.write(text) df2 = read_csv("memory://test/test.csv", parse_dates=["dt"]) tm.assert_frame_equal(df1, df2) @@ -282,7 +281,7 @@ def test_markdown_options(fsspectest): df = DataFrame({"a": [0]}) df.to_markdown("testmem://afile", storage_options={"test": "md_write"}) assert fsspectest.test[0] == "md_write" - assert fsspectest.cat("afile") + assert fsspectest.cat("testmem://afile") @td.skip_if_no("pyarrow")