Part of lp.testing.pgsql View In Hierarchy
Known subclasses: lp.testing.layers.LaunchpadTestSetup
Method | __init__ | Construct the PgTestSetup |
Method | superuser_connection | Undocumented |
Method | setUp | Create a fresh database (dropping the old if necessary) |
Method | tearDown | Close all outstanding connections and drop the database |
Method | connect | Get an open DB-API Connection object to a temporary database |
Method | dropDb | Drop the database if it exists. |
Method | force_dirty_database | flag the database as being dirty |
Method | _connectionString | Undocumented |
Note that dbuser is not used for setting up or tearing down the database - it is only used by the connect() method
Skips db creation if reset_db is False
This ensures that the database will be recreated for the next test. Tearing down the database is done automatically when we detect changes. Currently, however, not all changes are detectable (such as database changes made from a subprocess.