def make_repl_conn(self, **kwargs):
"""Create a new replication connection to the test database.
The connection is asynchronous, and will be closed on teardown().
"""
cnn = psycopg2.connect(
self.dsn, connection_factory=LogicalReplicationConnection,
async_=True, **kwargs)
wait_select(cnn)
self._conns.append(cnn)
return cnn
评论列表
文章目录