Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
NA
Issue Description
Sometimes when deprecating something I will find a test like:
def test_foo():
with tm.assert_produces_warning(UnrelatedWarning, match=unrelated_msg):
thing_that_i_am_deprecating()
When this happens, the only viable option I'm aware of is to change UnrelatedWarning
to (UnrelatedWarning, FutureWarning)
. But this doesn't a) check that we get both or b) check that we get a reasonable message for the FutureWarning.
The request here is for a way to specify a list of (warning, msg) pairs and check that we get all of them and no others. Or to make @pytest.mark.filterwarnings("ignore:my_message:FutureWarning")
actually work in this context.
Expected Behavior
NA
Installed Versions
Replace this line with the output of pd.show_versions()