> ... a wrapper which prevents any other warnings which are not trapped. I was toying with the idea of applying this across the codebase ...

Yes, nice idea
But surely in *this* case surely there just can't be any other warnings, as you mock out ```warnings.warn```.
Or am I missing some subtle way you can still get (other) warnings ?