pytest-exasol-extension 0.2.4__tar.gz → 1.0.0__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.
@@ -1,18 +1,18 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pytest-exasol-extension
3
- Version: 0.2.4
3
+ Version: 1.0.0
4
4
  Summary:
5
5
  Author: Mikhail Beck
6
6
  Author-email: mikhail.beck@exasol.com
7
- Requires-Python: >=3.10,<4.0
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
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: exasol-python-extension-common (>=0.10.0,<1)
13
+ Requires-Dist: exasol-python-extension-common (>=0.12.1,<1)
14
14
  Requires-Dist: exasol-saas-api (>=2.3,<3)
15
- Requires-Dist: pyexasol (>1,<2)
15
+ Requires-Dist: pyexasol (>=1.0.0,<3)
16
16
  Requires-Dist: pytest (>=7,<9)
17
17
  Requires-Dist: pytest-exasol-backend (>=1.1,<2)
18
18
  Description-Content-Type: text/markdown
@@ -2,9 +2,12 @@ from __future__ import annotations
2
2
 
3
3
  import random
4
4
  import string
5
+ from collections.abc import (
6
+ Callable,
7
+ Iterable,
8
+ )
5
9
  from typing import (
6
10
  Any,
7
- Callable,
8
11
  )
9
12
  from urllib.parse import urlparse
10
13
 
@@ -19,6 +22,9 @@ from exasol.python_extension_common.connections.bucketfs_location import (
19
22
  create_bucketfs_conn_object_onprem,
20
23
  create_bucketfs_conn_object_saas,
21
24
  )
25
+ from tenacity import retry
26
+ from tenacity.stop import stop_after_attempt
27
+ from tenacity.wait import wait_exponential
22
28
 
23
29
 
24
30
  @pytest.fixture(scope="session")
@@ -32,26 +38,39 @@ def db_schema_name() -> str:
32
38
  return "".join(random.choice(string.ascii_uppercase) for _ in range(12))
33
39
 
34
40
 
41
+ @retry(
42
+ reraise=True,
43
+ wait=wait_exponential(multiplier=1, min=5, max=15),
44
+ stop=stop_after_attempt(5),
45
+ )
46
+ def _open_pyexasol_connection(
47
+ database_params: dict[str, Any],
48
+ ) -> pyexasol.ExaConnection:
49
+ return pyexasol.connect(**database_params, compression=True)
50
+
51
+
35
52
  @pytest.fixture(scope="session")
36
53
  def pyexasol_connection(
37
54
  backend_aware_database_params, db_schema_name
38
- ) -> pyexasol.ExaConnection:
55
+ ) -> Iterable[pyexasol.ExaConnection]:
39
56
  """
40
57
  The fixture provides a database connection. It opens the test schema,
41
58
  creating it if it doesn't exist. In the latter case the schema gets
42
59
  deleted and the end of the fixture's life span.
43
60
  """
44
- with pyexasol.connect(**backend_aware_database_params, compression=True) as conn:
61
+ conn = _open_pyexasol_connection(backend_aware_database_params)
62
+ use_temp_schema = False
63
+ try:
45
64
  sql = f"SELECT * FROM SYS.EXA_SCHEMAS WHERE SCHEMA_NAME = '{db_schema_name}'"
46
65
  use_temp_schema = len(conn.execute(sql).fetchall()) == 0
47
66
  if use_temp_schema:
48
67
  conn.execute(f'CREATE SCHEMA "{db_schema_name}"')
49
68
  conn.execute(f'OPEN SCHEMA "{db_schema_name}"')
50
- try:
51
- yield conn
52
- finally:
53
- if use_temp_schema:
54
- conn.execute(f'DROP SCHEMA "{db_schema_name}" CASCADE')
69
+ yield conn
70
+ finally:
71
+ if use_temp_schema:
72
+ conn.execute(f'DROP SCHEMA IF EXISTS "{db_schema_name}" CASCADE')
73
+ conn.close()
55
74
 
56
75
 
57
76
  @pytest.fixture(scope="session")
@@ -1,15 +1,15 @@
1
1
  """
2
2
  ATTENTION:
3
3
  This file is generated by exasol/toolbox/nox/_package_version.py when using:
4
- * either "poetry run -- nox -s project:fix"
4
+ * either "poetry run -- nox -s format:fix"
5
5
  * or "poetry run -- nox -s version:check -- --fix"
6
6
  Do not edit this file manually!
7
7
  If you need to change the version, do so in the pyproject.toml, e.g. by using
8
8
  `poetry version X.Y.Z`.
9
9
  """
10
10
 
11
- MAJOR = 0
12
- MINOR = 2
13
- PATCH = 4
11
+ MAJOR = 1
12
+ MINOR = 0
13
+ PATCH = 0
14
14
  VERSION = f"{MAJOR}.{MINOR}.{PATCH}"
15
15
  __version__ = VERSION
@@ -1,29 +1,29 @@
1
1
  [project]
2
2
  name = "pytest-exasol-extension"
3
- version = "0.2.4"
4
- requires-python = ">=3.10,<4.0"
3
+ version = "1.0.0"
4
+ requires-python = ">=3.10,<3.14"
5
5
  description = ""
6
6
  authors = [
7
7
  {name="Mikhail Beck", email="mikhail.beck@exasol.com"}
8
8
  ]
9
9
  readme = "README.md"
10
+ dependencies = [
11
+ "pytest>=7,<9",
12
+ "pytest-exasol-backend>=1.1,<2",
13
+ "pyexasol>=1.0.0,<3",
14
+ "exasol-python-extension-common>=0.12.1,<1",
15
+ "exasol-saas-api>=2.3,<3",
16
+ ]
17
+
18
+ [project.entry-points.pytest11]
19
+ ext = "exasol.pytest_extension"
10
20
 
11
21
  [tool.poetry]
12
22
  requires-poetry = ">=2.1.0"
13
23
  packages = [{include = "exasol"}]
14
24
 
15
- [tool.poetry.dependencies]
16
- pytest = ">=7,<9"
17
- pytest-exasol-backend = ">=1.1, <2"
18
- pyexasol = ">1,<2"
19
- exasol-python-extension-common = ">=0.10.0,<1"
20
- exasol-saas-api = ">=2.3,<3"
21
-
22
- [tool.poetry.plugins.pytest11]
23
- ext = "exasol.pytest_extension"
24
-
25
25
  [tool.poetry.group.dev.dependencies]
26
- exasol-toolbox = "^1.6.0"
26
+ exasol-toolbox = "^5.0.0"
27
27
  exasol-bucketfs = ">=1.0.0"
28
28
  click = "^8.1.7"
29
29
 
@@ -40,32 +40,39 @@ source = [
40
40
  [tool.coverage.report]
41
41
  fail_under = 15
42
42
 
43
-
44
43
  [tool.black]
45
44
  line-length = 88
46
45
  verbose = false
47
46
  include = "\\.pyi?$"
48
47
 
49
-
50
48
  [tool.isort]
51
49
  profile = "black"
52
50
  force_grid_wrap = 2
53
51
 
54
-
55
52
  [tool.pylint.master]
56
- fail-under = 6.7
53
+ fail-under = 5.0
54
+ ignore = []
57
55
  output-format = "colorized,json:.lint.json,text:.lint.txt"
58
56
 
59
57
  [tool.pylint.format]
60
58
  max-line-length = 88
61
59
  max-module-lines = 800
62
60
 
61
+ [tool.ruff.lint]
62
+ extend-ignore = [
63
+ "E", # Syntax errors
64
+ "F", # Pyflakes rules (excluding F401)
65
+ "UP", # pyupgrade rules
66
+ "D", # Docstring rules
67
+ ]
68
+ extend-select = ["F401"]
69
+ unfixable = []
63
70
 
64
71
  [[tool.mypy.overrides]]
65
72
  module = [
66
73
  "test.unit.*",
67
74
  "test.integration.*",
68
- "pyexasol.*",
75
+ "pyexasol",
69
76
  ]
70
77
  ignore_errors = true
71
78
  ignore_missing_imports = true
@@ -74,3 +81,4 @@ ignore_missing_imports = true
74
81
  projectKey = "com.exasol:pytest-extension"
75
82
  hostUrl = "https://sonarcloud.io"
76
83
  organization = "exasol"
84
+ exclusions = "exasol/pytest_extension/version.py"