def temp_db(): db.create_all() try: yield db finally: db.session.remove() db.drop_all() r.flushdb()
def flush_db(): r.flushdb()
def teardown_method(self, method): self.fetch_detail_patch.stop() r.flushdb()
def setup_method(self, method): self.fetch_detail_patch = patch('tasks.fetch_detail') self.fetch_detail = self.fetch_detail_patch.start() r.flushdb()
def teardown_method(self, method): r.flushdb()
def teardown_method(self, method): self.get_listing_data_patch.stop() r.flushdb()
def setup_method(self, method): r.flushdb() self.get_listing_data_patch = patch('tasks.get_listing_data') self.get_listing_data = self.get_listing_data_patch.start()
def teardown_method(self, method): self.get_treasuries_patch.stop() r.flushdb()
def setup_method(self, method): self.get_treasuries_patch = patch('tasks.get_treasuries') self.get_treasuries = self.get_treasuries_patch.start() self.get_treasuries.return_value = fake_treasuries() r.flushdb()