When retrying a test, if a deprecation warning has been emitted the
first time, it will not be re-emitted the second time, and will
therefore not be shown in logs. Use warnings.catch_warnings() to reset
the "emission counter" of the warnings.
Part-of: odoo/odoo#92411