diff --git a/pandas/tests/io/parser/test_unsupported.py b/pandas/tests/io/parser/test_unsupported.py index 8d4c28bd61fa1..44a55cf3be240 100644 --- a/pandas/tests/io/parser/test_unsupported.py +++ b/pandas/tests/io/parser/test_unsupported.py @@ -155,12 +155,8 @@ def test_pyarrow_engine(self): kwargs[default] = "warn" warn = None - depr_msg = None + depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated" if "delim_whitespace" in kwargs: - depr_msg = "The 'delim_whitespace' keyword in pd.read_csv is deprecated" - warn = FutureWarning - if "verbose" in kwargs: - depr_msg = "The 'verbose' keyword in pd.read_csv is deprecated" warn = FutureWarning with pytest.raises(ValueError, match=msg):