MCPcopy
hub / github.com/psycopg/psycopg / test_interaction_dbapi_transaction

Function test_interaction_dbapi_transaction

tests/test_transaction_async.py:132–144  ·  view source on GitHub ↗
(aconn)

Source from the content-addressed store, hash-verified

130
131
132async def test_interaction_dbapi_transaction(aconn):
133 await insert_row(aconn, "foo")
134
135 async with aconn.transaction():
136 await insert_row(aconn, "bar")
137 raise Rollback
138
139 async with aconn.transaction():
140 await insert_row(aconn, "baz")
141
142 assert in_transaction(aconn)
143 await aconn.commit()
144 assert await inserted(aconn) == {"foo", "baz"}
145
146
147async def test_prohibits_use_of_commit_rollback_autocommit(aconn):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected