We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15cd56d commit 390d458Copy full SHA for 390d458
python/tests/test_connection.py
@@ -1,6 +1,6 @@
1
import pytest
2
3
-from psqlpy import PSQLPool, QueryResult
+from psqlpy import PSQLPool, QueryResult, Transaction
4
5
6
@pytest.mark.anyio
@@ -17,3 +17,14 @@ async def test_connection_execute(
17
)
18
assert isinstance(conn_result, QueryResult)
19
assert len(conn_result.result()) == number_database_records
20
+
21
22
+@pytest.mark.anyio
23
+async def test_connection_transaction(
24
+ psql_pool: PSQLPool,
25
+) -> None:
26
+ """Test that connection can create transactions."""
27
+ connection = await psql_pool.connection()
28
+ transaction = connection.transaction()
29
30
+ assert isinstance(transaction, Transaction)
0 commit comments