Adding upstream version 1.1.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
a7c3cb7344
commit
7269eaf22a
23 changed files with 4597 additions and 0 deletions
43
tests/conftest.py
Normal file
43
tests/conftest.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue