pytest-exasol-extension 0.2.4__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/PKG-INFO +2 -2
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/exasol/pytest_extension/__init__.py +24 -7
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/exasol/pytest_extension/version.py +1 -1
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/pyproject.toml +13 -3
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/README.md +0 -0
- {pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/exasol/pytest_extension/py.typed +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pytest-exasol-extension
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Mikhail Beck
|
|
6
6
|
Author-email: mikhail.beck@exasol.com
|
|
7
|
-
Requires-Python: >=3.10,<
|
|
7
|
+
Requires-Python: >=3.10,<3.14
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
{pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/exasol/pytest_extension/__init__.py
RENAMED
|
@@ -5,6 +5,7 @@ import string
|
|
|
5
5
|
from typing import (
|
|
6
6
|
Any,
|
|
7
7
|
Callable,
|
|
8
|
+
Iterable,
|
|
8
9
|
)
|
|
9
10
|
from urllib.parse import urlparse
|
|
10
11
|
|
|
@@ -19,6 +20,9 @@ from exasol.python_extension_common.connections.bucketfs_location import (
|
|
|
19
20
|
create_bucketfs_conn_object_onprem,
|
|
20
21
|
create_bucketfs_conn_object_saas,
|
|
21
22
|
)
|
|
23
|
+
from tenacity import retry
|
|
24
|
+
from tenacity.stop import stop_after_attempt
|
|
25
|
+
from tenacity.wait import wait_exponential
|
|
22
26
|
|
|
23
27
|
|
|
24
28
|
@pytest.fixture(scope="session")
|
|
@@ -32,26 +36,39 @@ def db_schema_name() -> str:
|
|
|
32
36
|
return "".join(random.choice(string.ascii_uppercase) for _ in range(12))
|
|
33
37
|
|
|
34
38
|
|
|
39
|
+
@retry(
|
|
40
|
+
reraise=True,
|
|
41
|
+
wait=wait_exponential(multiplier=1, min=5, max=15),
|
|
42
|
+
stop=stop_after_attempt(5),
|
|
43
|
+
)
|
|
44
|
+
def _open_pyexasol_connection(
|
|
45
|
+
database_params: dict[str, Any],
|
|
46
|
+
) -> pyexasol.ExaConnection:
|
|
47
|
+
return pyexasol.connect(**database_params, compression=True)
|
|
48
|
+
|
|
49
|
+
|
|
35
50
|
@pytest.fixture(scope="session")
|
|
36
51
|
def pyexasol_connection(
|
|
37
52
|
backend_aware_database_params, db_schema_name
|
|
38
|
-
) -> pyexasol.ExaConnection:
|
|
53
|
+
) -> Iterable[pyexasol.ExaConnection]:
|
|
39
54
|
"""
|
|
40
55
|
The fixture provides a database connection. It opens the test schema,
|
|
41
56
|
creating it if it doesn't exist. In the latter case the schema gets
|
|
42
57
|
deleted and the end of the fixture's life span.
|
|
43
58
|
"""
|
|
44
|
-
|
|
59
|
+
conn = _open_pyexasol_connection(backend_aware_database_params)
|
|
60
|
+
use_temp_schema = False
|
|
61
|
+
try:
|
|
45
62
|
sql = f"SELECT * FROM SYS.EXA_SCHEMAS WHERE SCHEMA_NAME = '{db_schema_name}'"
|
|
46
63
|
use_temp_schema = len(conn.execute(sql).fetchall()) == 0
|
|
47
64
|
if use_temp_schema:
|
|
48
65
|
conn.execute(f'CREATE SCHEMA "{db_schema_name}"')
|
|
49
66
|
conn.execute(f'OPEN SCHEMA "{db_schema_name}"')
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
67
|
+
yield conn
|
|
68
|
+
finally:
|
|
69
|
+
if use_temp_schema:
|
|
70
|
+
conn.execute(f'DROP SCHEMA IF EXISTS "{db_schema_name}" CASCADE')
|
|
71
|
+
conn.close()
|
|
55
72
|
|
|
56
73
|
|
|
57
74
|
@pytest.fixture(scope="session")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pytest-exasol-extension"
|
|
3
|
-
version = "0.2.
|
|
4
|
-
requires-python = ">=3.10,<
|
|
3
|
+
version = "0.2.5"
|
|
4
|
+
requires-python = ">=3.10,<3.14"
|
|
5
5
|
description = ""
|
|
6
6
|
authors = [
|
|
7
7
|
{name="Mikhail Beck", email="mikhail.beck@exasol.com"}
|
|
@@ -23,7 +23,7 @@ exasol-saas-api = ">=2.3,<3"
|
|
|
23
23
|
ext = "exasol.pytest_extension"
|
|
24
24
|
|
|
25
25
|
[tool.poetry.group.dev.dependencies]
|
|
26
|
-
exasol-toolbox = "^
|
|
26
|
+
exasol-toolbox = "^3.0.0"
|
|
27
27
|
exasol-bucketfs = ">=1.0.0"
|
|
28
28
|
click = "^8.1.7"
|
|
29
29
|
|
|
@@ -60,6 +60,15 @@ output-format = "colorized,json:.lint.json,text:.lint.txt"
|
|
|
60
60
|
max-line-length = 88
|
|
61
61
|
max-module-lines = 800
|
|
62
62
|
|
|
63
|
+
[tool.ruff.lint]
|
|
64
|
+
extend-ignore = [
|
|
65
|
+
"E", # Syntax errors
|
|
66
|
+
"F", # Pyflakes rules (excluding F401)
|
|
67
|
+
"UP", # pyupgrade rules
|
|
68
|
+
"D", # Docstring rules
|
|
69
|
+
]
|
|
70
|
+
extend-select = ["F401"]
|
|
71
|
+
unfixable = []
|
|
63
72
|
|
|
64
73
|
[[tool.mypy.overrides]]
|
|
65
74
|
module = [
|
|
@@ -74,3 +83,4 @@ ignore_missing_imports = true
|
|
|
74
83
|
projectKey = "com.exasol:pytest-extension"
|
|
75
84
|
hostUrl = "https://sonarcloud.io"
|
|
76
85
|
organization = "exasol"
|
|
86
|
+
exclusions = "exasol/pytest_extension/version.py"
|
|
File without changes
|
{pytest_exasol_extension-0.2.4 → pytest_exasol_extension-0.2.5}/exasol/pytest_extension/py.typed
RENAMED
|
File without changes
|