I think that it would be fantastic if ignore_warnings could be a context manager, as the above example shows.