MCPcopy
hub / github.com/psycopg/psycopg / conn

Function conn

tests/fix_db.py:199–206  ·  view source on GitHub ↗

Return a `Connection` connected to the ``--test-dsn`` database.

(conn_cls, dsn, request, tracefile)

Source from the content-addressed store, hash-verified

197
198@pytest.fixture
199def conn(conn_cls, dsn, request, tracefile):
200 """Return a `Connection` connected to the ``--test-dsn`` database."""
201 check_connection_version(request.node)
202
203 conn = conn_cls.connect(dsn)
204 with maybe_trace(conn.pgconn, tracefile, request.function):
205 yield conn
206 conn.close()
207
208
209@pytest.fixture(params=[True, False], ids=["pipeline=on", "pipeline=off"])

Callers

nothing calls this directly

Calls 4

check_connection_versionFunction · 0.85
maybe_traceFunction · 0.85
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected