CLN: Fix unwanted pattern in unittest
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Introduced with #37090

cc @jreback @mroeschke 

Fixes Checks failure on master, Merging as pre-commit and the relevant CI check both pass, and the rest isn't affected - thanks @phofl !