l.t.p.PgTestSetup : class documentation

Part of lp.testing.pgsql View In Hierarchy

Known subclasses: lp.testing.layers.LaunchpadTestSetup

No class docstring
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
def __init__(self, template=None, dbname=dynamic, dbuser=None, host=None, port=None):
Construct the PgTestSetup

Note that dbuser is not used for setting up or tearing down the database - it is only used by the connect() method

def _connectionString(self, dbname, dbuser=None):
Undocumented
def superuser_connection(self, dbname=None):
Undocumented
def setUp(self):
Create a fresh database (dropping the old if necessary)

Skips db creation if reset_db is False

def tearDown(self):
Close all outstanding connections and drop the database
def connect(self):
Get an open DB-API Connection object to a temporary database
def dropDb(self):
Drop the database if it exists.

Raises an exception if there are open connections

def force_dirty_database(self):
flag the database as being dirty

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.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.