def tear_down(self, success, exception=None):
    for f in self._log_file.values():
        if f:
            f.close()
def tear_down(self, success, exception=None):
    for f in self._log_file.values():
        if f:
            f.close()