This type of bug in the test code keeps biting back regularly, is hard to debug, and wastes review cycles: #30543 (comment) .
Fix all issues by catching it with a linter that checks for rule B008: https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
This also allows to drop the hand-written linter that checks for rule B006: https://docs.astral.sh/ruff/rules/mutable-argument-default/