def __exit__(self, exc_type, exc_value, traceback): _override_metrics(None)
def __enter__(self): self.records = [] _override_metrics([self]) return self