def setup(self): service = BasicService() try: service.kill() except ValueError: pass self.logfile = tempfile.NamedTemporaryFile(delete=False) self.logfile.close() self.handler = logging.FileHandler(self.logfile.name)
def teardown(self): service = BasicService() try: service.kill() except ValueError: pass try: os.unlink(self.logfile.name) except OSError: pass
def teardown(self): service = BasicService() service._debug('teardown') try: service.kill() except ValueError: pass try: os.unlink(self.logfile.name) except OSError: pass
def setup(self): with open(LOG_FILE, 'a') as f: f.write('\n\n{}\n'.format(get_current_case())) service = BasicService() try: service.kill() except ValueError: pass self.logfile = tempfile.NamedTemporaryFile(delete=False) self.logfile.close() self.handler = logging.FileHandler(self.logfile.name)