def test_db(postgresql): import psycopg2 from talisker.postgresql import TaliskerConnection with psycopg2.connect(postgresql.dsn) as ddl: with ddl.cursor() as cur: cur.execute(""" CREATE TABLE IF NOT EXISTS test ( id INTEGER PRIMARY KEY, value TEXT ); """) cur.execute("INSERT INTO test VALUES (1, 'foo')") return TaliskerConnection(postgresql.dsn)
def conn(postgresql): return TaliskerConnection(postgresql.dsn)