def tearDownClass(cls): if cls.client: # stop the flask server and the browser cls.client.get('http://localhost:5000/do/shutdown') cls.client.quit() cls.server_thread.join() # destroy database db.drop_all() db.session.remove() # remove application context cls.app_context.pop()
def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop()