Skip to content

Commit 61e51eb

Browse files
committed
Update test_deprecated_kwargs.py
Minimize code executed within assert_produces_warning context.
1 parent 181de47 commit 61e51eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/tests/io/json/test_deprecated_kwargs.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ def test_deprecated_kwargs():
1515
argument passed as positional.
1616
"""
1717
df = pd.DataFrame({"A": [2, 4, 6], "B": [3, 6, 9]}, index=[0, 1, 2])
18+
buf = df.to_json(orient="split")
1819
with tm.assert_produces_warning(FutureWarning):
19-
assert_frame_equal(df, read_json(df.to_json(orient="split"), "split"))
20+
assert_frame_equal(df, read_json(buf, "split"))
21+
buf = df.to_json(orient="columns")
2022
with tm.assert_produces_warning(FutureWarning):
21-
assert_frame_equal(df, read_json(df.to_json(orient="columns"), "columns"))
23+
assert_frame_equal(df, read_json(buf, "columns"))
24+
buf = df.to_json(orient="index")
2225
with tm.assert_produces_warning(FutureWarning):
23-
assert_frame_equal(df, read_json(df.to_json(orient="index"), "index"))
26+
assert_frame_equal(df, read_json(buf, "index"))
2427

2528

2629
def test_good_kwargs():

0 commit comments

Comments
 (0)