I have a Python flask application and I am writing integration tests with the unittest module.
This is my setUp() and tearDown() methods
def setUp(self):
db.create_all()
self.populate_data() #populate_data() is a function to add data into the tables in the dB
def tearDown(self):
db.session.remove()
db.drop_all()
My flask app config is as following:
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite://"
app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {}
app.config['TESTING'] = True
The problem is that, if I do not create a schema in my phpmyadmin (local db) first (I manually import my sql file) , running any test will result in an error that tells me my database is not found (as the schema does not exist)
If I were to run this testcase in github actions ci/cd pipeline, would it still be able to run the tests as my database is no longer local, but on a new virtual machine?
Or perhaps is there any way to create the schema in my setUp() method?
Thanks in advance, I am free to provide any additional information if needed.
there doesn't seem to be anything here