Skip to content

Commit 8331d06

Browse files
committed
Filter warning correctly
1 parent 42a46d7 commit 8331d06

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pandas/tests/io/json/test_pandas.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1608,12 +1608,10 @@ def test_emca_262_nan_inf_support(self):
16081608
)
16091609
tm.assert_frame_equal(result, expected)
16101610

1611-
@pytest.mark.filterwarnings("ignore:.*msgpack:FutureWarning")
1611+
@pytest.mark.filterwarnings("ignore:the 'numpy' keyword:FutureWarning")
16121612
def test_deprecate_numpy_argument_read_json(self):
1613-
# https://github.com/pandas-dev/pandas/issues/28512
1613+
# GH 28512
16141614
expected = DataFrame([1, 2, 3])
1615-
with tm.assert_produces_warning(None):
1616-
with catch_warnings():
1617-
filterwarnings("ignore", category=FutureWarning)
1618-
result = read_json(expected.to_json(), numpy=True)
1619-
tm.assert_frame_equal(result, expected)
1615+
with tm.assert_produces_warning(FutureWarning):
1616+
result = read_json(expected.to_json(), numpy=True)
1617+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)