Skip to content

Commit 3b28e5e

Browse files
committed
BUG: explicit test case pandas-dev#27135
1 parent 93a46db commit 3b28e5e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/io/json/test_readlines.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,15 @@ def test_readjson_nrows_requires_lines():
226226
def test_readjson_lines_chunks_fileurl(datapath):
227227
# GH 27135
228228
# Test reading line-format JSON from file url
229+
df_list_expected = [
230+
pd.DataFrame([[1, 2]], columns=["a", "b"], index=[0]),
231+
pd.DataFrame([[3, 4]], columns=["a", "b"], index=[1]),
232+
pd.DataFrame([[5, 6]], columns=["a", "b"], index=[2]),
233+
]
229234
os_path = datapath("io", "json", "data", "line_delimited.json")
230235
file_url = "file://localhost" + os_path
231236
if system() == "Windows":
232237
file_url = PureWindowsPath(file_url)
233-
path_reader = pd.read_json(os_path, lines=True, chunksize=1)
234-
df_list = list(path_reader)
235238
url_reader = pd.read_json(file_url, lines=True, chunksize=1)
236239
for index, chuck in enumerate(url_reader):
237-
tm.assert_frame_equal(chuck, df_list[index])
240+
tm.assert_frame_equal(chuck, df_list_expected[index])

0 commit comments

Comments
 (0)