pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
42.62k stars 17.57k forks source link

TST: Added script to enforce usage of match argument for tm.assert_produces_warning #59173

Open chaarvii opened 2 days ago

chaarvii commented 2 days ago

xref #58290

Added a script called enforce_match_arg_in_assert_produces_warning.py which checks that all usages of tm.assert_produces_warning make use of the match argument. This is done to ensure that users are always displayed the correct warning message. Uses of tm.assert_produces_warning(None) have been excluded as no warning is produced in this case.

Furthermore, to ensure that the existing code doesn't fail the pre-commit stage, all files that currently do not use the match argument have been excluded.