def setUp(self): realapp, db = seq_exp.setup_api_and_db('sqlite:///:memory:') self.realapp = realapp self.db = db self.db.create_tables() self.db_fd, self.realapp.config['DATABASE'] = tempfile.mkstemp() self.realapp.config['TESTING'] = True self.app = self.realapp.test_client()
import os import seq_exp.seq_exp as seq_exp if __name__ == "__main__": url = os.environ['DBURL'] if not url: url='sqlite:///:memory:' app, db = seq_exp.setup_api_and_db(url) app.run(debug=True)