this should return original_showwarning or a function that can recover warnings.showwarning, so that the caller can pass that to self.addCleanup().