MCPcopy
hub / github.com/psycopg/psycopg / test_exposes_associated_connection

Function test_exposes_associated_connection

tests/test_transaction_async.py:29–34  ·  view source on GitHub ↗

Transaction exposes its connection as a read-only property.

(aconn)

Source from the content-addressed store, hash-verified

27
28
29async def test_exposes_associated_connection(aconn):
30 """Transaction exposes its connection as a read-only property."""
31 async with aconn.transaction() as tx:
32 assert tx.connection is aconn
33 with pytest.raises(AttributeError):
34 tx.connection = aconn
35
36
37async def test_exposes_savepoint_name(aconn):

Callers

nothing calls this directly

Calls 1

transactionMethod · 0.45

Tested by

no test coverage detected