MCPcopy
hub / github.com/pandas-dev/pandas / test_read_csv

Function test_read_csv

pandas/tests/io/test_fsspec.py:75–83  ·  view source on GitHub ↗
(cleared_fs, df1)

Source from the content-addressed store, hash-verified

73
74
75def test_read_csv(cleared_fs, df1):
76 text = str(df1.to_csv(index=False)).encode()
77 with cleared_fs.open("test/test.csv", "wb") as w:
78 w.write(text)
79 df2 = read_csv("memory://test/test.csv", parse_dates=["dt"])
80
81 expected = df1.copy()
82 expected["dt"] = expected["dt"].astype("M8[us]")
83 tm.assert_frame_equal(df2, expected)
84
85
86def test_reasonable_error(monkeypatch, cleared_fs):

Callers

nothing calls this directly

Calls 7

read_csvFunction · 0.90
encodeMethod · 0.80
to_csvMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
copyMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected