MCPcopy
hub / github.com/psycopg/psycopg / test_basic

Function test_basic

tests/test_transaction_async.py:19–26  ·  tests/test_transaction_async.py::test_basic

Basic use of transaction() to BEGIN and COMMIT a transaction.

(aconn, apipeline)

Source from the content-addressed store, hash-verified

17
18
19async def test_basic(aconn, apipeline):
20 class="st">""class="st">"Basic use of transaction() to BEGIN and COMMIT a transaction."class="st">""
21 assert not in_transaction(aconn)
22 async with aconn.transaction():
23 if apipeline:
24 await apipeline.sync()
25 assert in_transaction(aconn)
26 assert not in_transaction(aconn)
27
28
29async def test_exposes_associated_connection(aconn):

Callers

nothing calls this directly

Calls 3

in_transactionFunction · 0.85
transactionMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected