userver: testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig Class Reference
Loading...
Searching...
No Matches
testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig Class Reference

Detailed Description

Definition at line 15 of file pytest_plugin.py.

Inheritance diagram for testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig:

Public Member Functions

 __init__ (self, list[discover.PgShardedDatabase] databases, control.PgControl pgsql_control, frozenset[str] cleanup_exclude_tables)
int __len__ (self)
typing.Iterator[str] __iter__ (self)
connection.PgConnectionInfo __getitem__ (self, str dbname)
 Get :py:class:testsuite.databases.pgsql.connection.PgConnectionInfo instance by database name.
dict[str, control.ConnectionWrapperinitialize (self, bool parallel_init)

Protected Attributes

bool _initialized = False
 _pgsql_control = pgsql_control
 _databases = databases
dict _shard_connections
 _cleanup_exclude_tables = cleanup_exclude_tables

Constructor & Destructor Documentation

◆ __init__()

testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig.__init__ ( self,
list[discover.PgShardedDatabase] databases,
control.PgControl pgsql_control,
frozenset[str] cleanup_exclude_tables )

Definition at line 16 of file pytest_plugin.py.

Member Function Documentation

◆ __getitem__()

connection.PgConnectionInfo testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig.__getitem__ ( self,
str dbname )

Get :py:class:testsuite.databases.pgsql.connection.PgConnectionInfo instance by database name.

Definition at line 40 of file pytest_plugin.py.

◆ __iter__()

typing.Iterator[str] testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig.__iter__ ( self)

Definition at line 37 of file pytest_plugin.py.

◆ __len__()

int testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig.__len__ ( self)

Definition at line 34 of file pytest_plugin.py.

◆ initialize()

dict[str, control.ConnectionWrapper] testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig.initialize ( self,
bool parallel_init )

Definition at line 47 of file pytest_plugin.py.

Member Data Documentation

◆ _cleanup_exclude_tables

testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig._cleanup_exclude_tables = cleanup_exclude_tables
protected

Definition at line 32 of file pytest_plugin.py.

◆ _databases

testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig._databases = databases
protected

Definition at line 24 of file pytest_plugin.py.

◆ _initialized

bool testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig._initialized = False
protected

Definition at line 22 of file pytest_plugin.py.

◆ _pgsql_control

testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig._pgsql_control = pgsql_control
protected

Definition at line 23 of file pytest_plugin.py.

◆ _shard_connections

testsuite.databases.pgsql.pytest_plugin.ServiceLocalConfig._shard_connections
protected
Initial value:
= {
shard.pretty_name: pgsql_control.get_connection_cached(
shard.dbname,
)
for db in self._databases
for shard in db.shards
}

Definition at line 25 of file pytest_plugin.py.


The documentation for this class was generated from the following file: