File: test_autocommit.py

package info (click to toggle)
python-asyncmy 0.2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: python: 3,528; makefile: 40
file content (14 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest


@pytest.mark.asyncio
async def test_autocommit(connection):
    await connection.autocommit(True)
    cursor = connection.cursor()
    await cursor.execute("SELECT @@autocommit;")
    assert await cursor.fetchone() == (1,)
    await cursor.close()
    await connection.autocommit(False)
    cursor = connection.cursor()
    await cursor.execute("SELECT @@autocommit;")
    assert await cursor.fetchone() == (0,)