1
0
Fork 0

Adding upstream version 1.1.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 20:14:26 +01:00
parent a7c3cb7344
commit 7269eaf22a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
23 changed files with 4597 additions and 0 deletions

43
tests/conftest.py Normal file
View file

@ -0,0 +1,43 @@
from __future__ import annotations
from typing import Generator
import pytest
from mysql.connector import connect
from harlequin_mysql.adapter import (
HarlequinMySQLAdapter,
HarlequinMySQLConnection,
)
@pytest.fixture
def connection() -> Generator[HarlequinMySQLConnection, None, None]:
mysqlconn = connect(
host="localhost",
user="root",
password="example",
database="mysql",
autocommit=True,
)
cur = mysqlconn.cursor()
cur.execute("drop database if exists test;")
cur.execute("drop database if exists one;")
cur.execute("drop database if exists two;")
cur.execute("drop database if exists three;")
cur.execute("create database test;")
cur.close()
conn = HarlequinMySQLAdapter(
conn_str=tuple(),
host="localhost",
user="root",
password="example",
database="test",
).connect()
yield conn
cur = mysqlconn.cursor()
cur.execute("drop database if exists test;")
cur.execute("drop database if exists one;")
cur.execute("drop database if exists two;")
cur.execute("drop database if exists three;")
cur.close()