MCPcopy
hub / github.com/psycopg/psycopg / test_commit_on_successful_exit

Function test_commit_on_successful_exit

tests/test_transaction_async.py:65–71  ·  view source on GitHub ↗

Changes are committed on successful exit from the `with` block.

(aconn)

Source from the content-addressed store, hash-verified

63
64
65async def test_commit_on_successful_exit(aconn):
66 """Changes are committed on successful exit from the `with` block."""
67 async with aconn.transaction():
68 await insert_row(aconn, "foo")
69
70 assert not in_transaction(aconn)
71 assert await inserted(aconn) == {"foo"}
72
73
74async def test_rollback_on_exception_exit(aconn):

Callers

nothing calls this directly

Calls 4

insert_rowFunction · 0.85
in_transactionFunction · 0.85
insertedFunction · 0.85
transactionMethod · 0.45

Tested by

no test coverage detected