testutils.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:Price-Comparator 作者: Thejas-1 项目源码 文件源码
def repl_connect(self, **kwargs):
        """Return a connection set up for replication

        The connection is on "PSYCOPG2_TEST_REPL_DSN" unless overridden by
        a *dsn* kwarg.

        Should raise a skip test if not available, but guard for None on
        old Python versions.
        """
        if 'dsn' not in kwargs:
            kwargs['dsn'] = repl_dsn
        import psycopg2
        try:
            conn = self.connect(**kwargs)
        except psycopg2.OperationalError, e:
            return self.skipTest("replication db not configured: %s" % e)

        conn.autocommit = True
        return conn
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号