I think this test should use the `with warnings.catch(record=True) as w:` idiom and check that each time the warning is raised.