def release(self): """Release service resource.""" self.storage.disconnect() Cause.reset() Config.reset() Logger.reset()
def logger_wrapper(request): """Create logger.""" from snippy.logger import Logger # Previous test may have configured the logger and therefore # the logger must be always reset before test. Logger.reset() logger = Logger.get_logger('snippy.' + __name__) def fin(): """Clear the resources at the end.""" Logger.remove() request.addfinalizer(fin) return logger