Skip to content

Commit 390d458

Browse files
committed
Added more tests
1 parent 15cd56d commit 390d458

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

python/tests/test_connection.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from psqlpy import PSQLPool, QueryResult
3+
from psqlpy import PSQLPool, QueryResult, Transaction
44

55

66
@pytest.mark.anyio
@@ -17,3 +17,14 @@ async def test_connection_execute(
1717
)
1818
assert isinstance(conn_result, QueryResult)
1919
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

Comments
 (0)