Issue #23029: Fix catch_warnings() in test_filename_none

It was printed UserWarning output because catch_warnings() was missing
record=True.
1 file changed