BasePostgresTest

class tests.test_postgres.BasePostgresTest(methodName='runTest')[source]

Shared base class for Postgres tests.

  • Sets up ExamplePostgresWrapper into the attribute wrp

  • Before each test (setUp()) it deletes and recreates the tables to avoid leftover tables/rows

  • After each test (tearDown()) it drops all tables to ensure no leftover tables once the tests are done.

__init__(methodName='runTest')

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

conn = None

Holds the module’s Postgres connection

setUp() → None[source]

Deletes and recreates all tables to avoid leftover tables/rows

classmethod setUpClass()[source]

Sets up a ExamplePostgresWrapper instance under wrp for use by tests

tearDown() → None[source]

Deletes all tables after each test finises to avoid leftover tables/rows

wrp = None

Holds a ExamplePostgresWrapper instance for use by test cases

Methods

Methods

setUp()

Deletes and recreates all tables to avoid leftover tables/rows

setUpClass()

Sets up a ExamplePostgresWrapper instance under wrp for use by tests

tearDown()

Deletes all tables after each test finises to avoid leftover tables/rows

Attributes

Attributes

conn

Holds the module’s Postgres connection