setup_database_connection (function)


Start a database connection using settings in yaml file

Given the location of a YAML dictionary containing database credientials, this function will setup and return the connection*

Key Arguments

  • pathToYamlFile – path to the YAML dictionary.


  • dbConn – connection to the MySQL database.


The settings file should be in this form, with all keyword values set:

db: unit_tests
host: localhost
user: utuser
password: utpass

And here’s how to generate the connection object:

from fundamentals.mysql import setup_database_connection
dbConn = setup_database_connection(