TemporaryPostgresInstance

class felis.tests.postgresql.TemporaryPostgresInstance(server, engine)

Bases: object

Wrapper for a temporary Postgres database.

Parameters:
  • server (None) – The testing.postgresql.Postgresql instance.

  • engine (Engine) – The SQLAlchemy engine for the temporary database server.

Notes

This class was copied and modified from lsst.daf.butler.tests.postgresql.

Attributes Summary

engine

Return the SQLAlchemy engine for the temporary database server.

url

Return connection URL for the temporary database server.

Methods Summary

begin()

Return a SQLAlchemy connection to the test database.

print_info()

Print information about the temporary database server.

Attributes Documentation

engine

Return the SQLAlchemy engine for the temporary database server.

Returns:

The SQLAlchemy engine.

Return type:

Engine

url

Return connection URL for the temporary database server.

Returns:

The connection URL.

Return type:

str

Methods Documentation

begin()

Return a SQLAlchemy connection to the test database.

Returns:

The SQLAlchemy connection.

Return type:

Connection

print_info()

Print information about the temporary database server.

Return type:

None