Closed termao6 closed 5 years ago
@mlp6 @suyashkumar
What type of database are you creating?
Regardless, you can use a pytest
fixture to create a database that you can test reading/writing to.
@mlp6 I'm using mysql, hosted locally on my computer and in python I'm using pymysql to connect to it. I looked into using fixtures, and it seems that we have to pass the database in to the functions we want to test - this seems doable, but kind of redundant passing in our 'connection' w/ mysql every time as opposed to it being a global variable we can call from anywhere in the file. Otherwise, if we do want it as a global var, we'd have to check if we're in a testing environment and config the database based on that - not entirely sure on the details of this, but I've seen in online/in other projects I've worked on, and I'm still not sure how this would work with pytest...
I guess my questions are: For the scope of this project, do we have to test these functions that involve the database in our Travis, or is it enough that we can ensure it works locally? if yes, When you say 'create a database' how would I create it so that it isn't local and so that I can test it on TravisCI? or do you have any other insights on this?
@suyashkumar recommendations?
I have a local database that I'm querying to - do I have to have tests in TravisCI for this? I can test locally, but not sure what to do with Travis