pytest-databases 0.16.0__tar.gz → 0.18.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.
Files changed (115) hide show
  1. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/workflows/ci.yaml +60 -10
  2. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/workflows/docs.yml +2 -5
  3. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/workflows/release.yaml +0 -3
  4. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.gitignore +5 -0
  5. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.pre-commit-config.yaml +1 -1
  6. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/PKG-INFO +2 -8
  7. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/conf.py +3 -0
  8. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/installation.rst +1 -1
  9. pytest_databases-0.18.0/docs/supported-databases/dolt.rst +64 -0
  10. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/index.rst +2 -0
  11. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/mariadb.rst +10 -18
  12. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/mysql.rst +12 -15
  13. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/postgres.rst +2 -1
  14. pytest_databases-0.18.0/docs/supported-databases/rustfs.rst +76 -0
  15. pytest_databases-0.18.0/docs/supported-databases/sqlserver.rst +48 -0
  16. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/yugabyte.rst +10 -9
  17. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/pyproject.toml +8 -8
  18. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/_service.py +29 -10
  19. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/azure_blob.py +1 -0
  20. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/bigquery.py +1 -0
  21. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/cockroachdb.py +1 -0
  22. pytest_databases-0.18.0/src/pytest_databases/docker/dolt.py +159 -0
  23. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/elastic_search.py +1 -0
  24. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/gizmosql.py +1 -0
  25. pytest_databases-0.18.0/src/pytest_databases/docker/mariadb.py +228 -0
  26. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/minio.py +45 -22
  27. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/mongodb.py +7 -3
  28. pytest_databases-0.18.0/src/pytest_databases/docker/mssql.py +227 -0
  29. pytest_databases-0.18.0/src/pytest_databases/docker/mysql.py +289 -0
  30. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/oracle.py +1 -0
  31. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/postgres.py +44 -1
  32. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/redis.py +18 -3
  33. pytest_databases-0.18.0/src/pytest_databases/docker/rustfs.py +148 -0
  34. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/spanner.py +1 -0
  35. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/valkey.py +6 -1
  36. pytest_databases-0.18.0/src/pytest_databases/docker/yugabyte.py +319 -0
  37. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/types.py +5 -1
  38. pytest_databases-0.18.0/tests/test_dolt.py +92 -0
  39. pytest_databases-0.18.0/tests/test_mariadb.py +96 -0
  40. pytest_databases-0.18.0/tests/test_minio.py +74 -0
  41. pytest_databases-0.18.0/tests/test_mssql.py +134 -0
  42. pytest_databases-0.18.0/tests/test_mysql.py +103 -0
  43. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_postgres.py +2 -0
  44. pytest_databases-0.18.0/tests/test_rustfs.py +79 -0
  45. pytest_databases-0.18.0/tests/test_rustfs_config.py +40 -0
  46. pytest_databases-0.18.0/tests/test_yugabyte.py +116 -0
  47. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/uv.lock +1863 -1554
  48. pytest_databases-0.16.0/docs/supported-databases/sqlserver.rst +0 -59
  49. pytest_databases-0.16.0/src/pytest_databases/docker/mariadb.py +0 -140
  50. pytest_databases-0.16.0/src/pytest_databases/docker/mssql.py +0 -126
  51. pytest_databases-0.16.0/src/pytest_databases/docker/mysql.py +0 -207
  52. pytest_databases-0.16.0/src/pytest_databases/docker/yugabyte.py +0 -96
  53. pytest_databases-0.16.0/tests/test_mariadb.py +0 -95
  54. pytest_databases-0.16.0/tests/test_minio.py +0 -85
  55. pytest_databases-0.16.0/tests/test_mssql.py +0 -121
  56. pytest_databases-0.16.0/tests/test_mysql.py +0 -95
  57. pytest_databases-0.16.0/tests/test_yugabyte.py +0 -106
  58. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/CODEOWNERS +0 -0
  59. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/dependabot.yaml +0 -0
  60. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/workflows/cd.yaml +0 -0
  61. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.github/workflows/pr-title.yaml +0 -0
  62. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.sourcery.yaml +0 -0
  63. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.vscode/launch.json +0 -0
  64. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/.vscode/settings.json +0 -0
  65. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/CODEOWNERS +0 -0
  66. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/CONTRIBUTING.rst +0 -0
  67. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/LICENSE +0 -0
  68. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/Makefile +0 -0
  69. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/README.md +0 -0
  70. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/.gitignore +0 -0
  71. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/__init__.py +0 -0
  72. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/_static/.gitkeep +0 -0
  73. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/_static/custom.css +0 -0
  74. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/_static/logo.svg +0 -0
  75. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/changelog.rst +0 -0
  76. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/contribution-guide.rst +0 -0
  77. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/basic-usage.rst +0 -0
  78. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/configuration.rst +0 -0
  79. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/enabling-plugins.rst +0 -0
  80. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/index.rst +0 -0
  81. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/getting-started/next-steps.rst +0 -0
  82. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/index.rst +0 -0
  83. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/azure_blob_storage.rst +0 -0
  84. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/bigquery.rst +0 -0
  85. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/cockroachdb.rst +0 -0
  86. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/elasticsearch.rst +0 -0
  87. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/gizmosql.rst +0 -0
  88. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/minio.rst +0 -0
  89. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/mongodb.rst +0 -0
  90. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/oracle.rst +0 -0
  91. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/redis.rst +0 -0
  92. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/spanner.rst +0 -0
  93. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/docs/supported-databases/valkey.rst +0 -0
  94. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/scripts/__init__.py +0 -0
  95. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/scripts/build_docs.py +0 -0
  96. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/scripts/convert_docs.sh +0 -0
  97. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/scripts/install-hatch.sh +0 -0
  98. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/sonar-project.properties +0 -0
  99. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/__init__.py +0 -0
  100. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/__metadata__.py +0 -0
  101. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/docker/__init__.py +0 -0
  102. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/helpers.py +0 -0
  103. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/src/pytest_databases/py.typed +0 -0
  104. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/__init__.py +0 -0
  105. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/conftest.py +0 -0
  106. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_azure_blob.py +0 -0
  107. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_bigquery.py +0 -0
  108. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_cockroachdb.py +0 -0
  109. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_elasticsearch.py +0 -0
  110. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_gizmosql.py +0 -0
  111. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_mongodb.py +0 -0
  112. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_oracle.py +0 -0
  113. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_redis.py +0 -0
  114. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_spanner.py +0 -0
  115. {pytest_databases-0.16.0 → pytest_databases-0.18.0}/tests/test_valkey.py +0 -0
@@ -18,19 +18,16 @@ jobs:
18
18
  test:
19
19
  name: Python ${{ matrix.python-version }} - ${{ matrix.cdist-group }}/3
20
20
  runs-on: ubuntu-latest
21
- timeout-minutes: 10
21
+ timeout-minutes: 15
22
22
  strategy:
23
23
  fail-fast: false
24
24
  matrix:
25
- python-version: ["3.9", "3.10", "3.11", "3.12"]
25
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
26
26
  cdist-group: [1, 2, 3]
27
27
 
28
28
  steps:
29
29
  - uses: actions/checkout@v6
30
30
 
31
- - name: Install additional dependencies
32
- run: sudo apt-get update && sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 libmariadb-dev && sudo apt-get autoremove -y && sudo apt-get clean -y
33
-
34
31
  - name: Set up Python ${{ matrix.python-version }}
35
32
  uses: actions/setup-python@v6
36
33
  with:
@@ -42,6 +39,50 @@ jobs:
42
39
  - name: Intall dependencies
43
40
  run: uv sync --frozen --all-extras
44
41
 
42
+ # Pre-pull docker images with retry to absorb transient registry failures
43
+ # (MCR WAF blocks on mcr.microsoft.com, Docker Hub anonymous rate limits)
44
+ # before pytest starts spawning fixture subprocesses. Pull in parallel
45
+ # (-P 6) - sequential pulls of ~30 images cost 10+ min on a runner.
46
+ - name: Pre-pull docker images
47
+ run: |
48
+ set -u
49
+ images=(
50
+ "mcr.microsoft.com/azure-storage/azurite"
51
+ "mcr.microsoft.com/mssql/server:2022-latest"
52
+ "dolthub/dolt-sql-server:latest"
53
+ "postgres:11" "postgres:12" "postgres:13" "postgres:14"
54
+ "postgres:15" "postgres:16" "postgres:17" "postgres:18"
55
+ "pgvector/pgvector:pg15"
56
+ "paradedb/paradedb:0.21.5-pg16"
57
+ "google/alloydbomni:16"
58
+ "mysql:5.6" "mysql:5.7" "mysql:8"
59
+ "mariadb:11.3"
60
+ "gvenzl/oracle-free:23-slim-faststart"
61
+ "gvenzl/oracle-xe:18-slim-faststart"
62
+ "redis:latest"
63
+ "valkey/valkey:latest"
64
+ "mongo:latest"
65
+ "cockroachdb/cockroach:latest"
66
+ "software.yugabyte.com/yugabytedb/yugabyte:latest"
67
+ "quay.io/minio/minio"
68
+ "minio/mc:latest"
69
+ "rustfs/rustfs:latest"
70
+ "rustfs/rc:latest"
71
+ "gcr.io/cloud-spanner-emulator/emulator:latest"
72
+ "ghcr.io/goccy/bigquery-emulator:latest"
73
+ "gizmodata/gizmosql:latest"
74
+ )
75
+ printf '%s\n' "${images[@]}" | xargs -n1 -P6 -I{} bash -c '
76
+ image="$1"
77
+ for attempt in 1 2 3 4 5; do
78
+ if docker pull --quiet "$image"; then
79
+ exit 0
80
+ fi
81
+ [ "$attempt" -lt 5 ] && sleep $((attempt * attempt * 5))
82
+ done
83
+ echo "::warning::Failed to pull $image after 5 attempts"
84
+ ' _ {}
85
+
45
86
  - if: matrix.python-version == '3.12'
46
87
  name: Run tests with coverage tracking
47
88
  run: uv run pytest --cdist-group=${{ matrix.cdist-group }}/3 -k "not elasticsearch"
@@ -51,14 +92,14 @@ jobs:
51
92
  run: uv run pytest --cdist-group=${{ matrix.cdist-group }}/3 -k "not elasticsearch"
52
93
 
53
94
  - if: matrix.python-version == '3.12'
54
- uses: actions/upload-artifact@v6
95
+ uses: actions/upload-artifact@v7
55
96
  with:
56
97
  name: coverage-xml
57
98
  path: coverage.xml
58
99
 
59
100
  - if: matrix.python-version == '3.12'
60
101
  name: Upload coverage reports to Codecov
61
- uses: codecov/codecov-action@v5.5.2
102
+ uses: codecov/codecov-action@v6.0.0
62
103
  with:
63
104
  token: ${{ secrets.CODECOV_TOKEN }}
64
105
  slug: litestar-org/pytest-databases
@@ -67,9 +108,6 @@ jobs:
67
108
  test_elasticsearch:
68
109
  runs-on: ubuntu-latest
69
110
  steps:
70
- - name: Install additional dependencies
71
- run: sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 libmariadb-dev
72
-
73
111
  - uses: actions/checkout@v6
74
112
 
75
113
  - name: Set up Python
@@ -83,6 +121,18 @@ jobs:
83
121
  - name: Intall dependencies
84
122
  run: uv sync --frozen --all-extras
85
123
 
124
+ - name: Pre-pull docker images
125
+ run: |
126
+ set -u
127
+ for image in "elasticsearch:7.17.19" "elasticsearch:8.13.0"; do
128
+ for attempt in 1 2 3 4 5; do
129
+ if docker pull --quiet "$image"; then
130
+ break
131
+ fi
132
+ [ "$attempt" -eq 5 ] && echo "::warning::Failed to pull $image" || sleep $((attempt * attempt * 5))
133
+ done
134
+ done
135
+
86
136
  - name: Run tests with coverage tracking
87
137
  run: uv run pytest -k elasticsearch
88
138
 
@@ -22,9 +22,6 @@ jobs:
22
22
  steps:
23
23
  - uses: actions/checkout@v6
24
24
 
25
- - name: Install additional dependencies
26
- run: sudo apt-get update && sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 libmariadb-dev && sudo apt-get autoremove -y && sudo apt-get clean -y
27
-
28
25
  - name: Set up Python ${{ matrix.python-version }}
29
26
  uses: actions/setup-python@v6
30
27
  with:
@@ -43,10 +40,10 @@ jobs:
43
40
  run: uv run scripts/build_docs.py dist/docs
44
41
 
45
42
  - name: Upload artifact
46
- uses: actions/upload-pages-artifact@v4
43
+ uses: actions/upload-pages-artifact@v5
47
44
  with:
48
45
  path: dist/docs/
49
46
 
50
47
  - name: Deploy to GitHub Pages
51
48
  id: deployment
52
- uses: actions/deploy-pages@v4
49
+ uses: actions/deploy-pages@v5
@@ -12,9 +12,6 @@ jobs:
12
12
  id-token: write
13
13
  environment: release
14
14
  steps:
15
- - name: Install additional dependencies
16
- run: sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 libmariadb-dev
17
-
18
15
  - name: Check out repository
19
16
  uses: actions/checkout@v6
20
17
 
@@ -150,3 +150,8 @@ node_modules
150
150
  .astro
151
151
  .vite
152
152
  .npmrc
153
+ .agents/
154
+ .beads/
155
+ .gemini/
156
+ .claude/
157
+ .geminiignore
@@ -19,7 +19,7 @@ repos:
19
19
 
20
20
  # Ruff replaces black, flake8, autoflake and isort
21
21
  - repo: https://github.com/charliermarsh/ruff-pre-commit
22
- rev: "v0.14.13" # make sure this is always consistent with hatch configs
22
+ rev: "v0.15.12" # make sure this is always consistent with hatch configs
23
23
  hooks:
24
24
  - id: ruff
25
25
  args: [--config, ./pyproject.toml]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-databases
3
- Version: 0.16.0
3
+ Version: 0.18.0
4
4
  Summary: Reusable database fixtures for any and all databases.
5
5
  Project-URL: Documentation, https://github.com/litestar-org/pytest-databases#readme
6
6
  Project-URL: Issues, https://github.com/litestar-org/pytest-databases/issues
@@ -8,7 +8,7 @@ Project-URL: Source, https://github.com/litestar-org/pytest-databases
8
8
  Author-email: Cody Fincher <cody@litestar.dev>
9
9
  License-Expression: MIT
10
10
  License-File: LICENSE
11
- Keywords: alloydb,alloydbomni,azure,bigquery,cockroachdb,database,dragonflydb,duckdb,elasticsearch,flightsql,gizmosql,migration,mongodb,mssql,mysql,oracle,postgres,redis,spanner,valkey
11
+ Keywords: alloydb,alloydbomni,azure,bigquery,cockroachdb,database,doltdb,dragonflydb,duckdb,elasticsearch,flightsql,gizmosql,migration,mongodb,mssql,mysql,oracle,postgres,redis,spanner,valkey
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3.9
@@ -40,15 +40,10 @@ Requires-Dist: pyarrow; extra == 'gizmosql'
40
40
  Provides-Extra: keydb
41
41
  Requires-Dist: redis; extra == 'keydb'
42
42
  Provides-Extra: mariadb
43
- Requires-Dist: mariadb; extra == 'mariadb'
44
- Provides-Extra: minio
45
- Requires-Dist: minio; extra == 'minio'
46
43
  Provides-Extra: mongodb
47
44
  Requires-Dist: pymongo; extra == 'mongodb'
48
45
  Provides-Extra: mssql
49
- Requires-Dist: pymssql; extra == 'mssql'
50
46
  Provides-Extra: mysql
51
- Requires-Dist: mysql-connector-python; extra == 'mysql'
52
47
  Provides-Extra: oracle
53
48
  Requires-Dist: oracledb; extra == 'oracle'
54
49
  Provides-Extra: postgres
@@ -60,7 +55,6 @@ Requires-Dist: google-cloud-spanner; extra == 'spanner'
60
55
  Provides-Extra: valkey
61
56
  Requires-Dist: valkey; extra == 'valkey'
62
57
  Provides-Extra: yugabyte
63
- Requires-Dist: psycopg2-yugabytedb; extra == 'yugabyte'
64
58
  Description-Content-Type: text/markdown
65
59
 
66
60
  <!-- markdownlint-disable no-inline-html -->
@@ -62,6 +62,9 @@ autodoc_default_options = {
62
62
  "undoc-members": True,
63
63
  "exclude-members": "__weakref__",
64
64
  }
65
+ autodoc_type_aliases = {
66
+ "Container": "docker.models.containers.Container",
67
+ }
65
68
 
66
69
  # Mock imports for modules not needed during doc generation
67
70
  autodoc_mock_imports = ["OpenSSL"]
@@ -27,7 +27,7 @@ To use ``pytest-databases`` with specific databases, you need to install optiona
27
27
  * - Oracle
28
28
  - ``pytest-databases[oracle]``
29
29
  * - SQL Server
30
- - ``pytest-databases[sqlserver]``
30
+ - ``pytest-databases[mssql]``
31
31
  * - Google AlloyDB Omni
32
32
  - ``pytest-databases[alloydb]``
33
33
  * - Google Spanner
@@ -0,0 +1,64 @@
1
+ Dolt
2
+ ====
3
+
4
+ Integration with `Dolt <https://www.dolthub.com/>`_
5
+
6
+ Dolt is a MySQL-compatible database that provides Git-like versioning for your data.
7
+
8
+ Installation
9
+ ------------
10
+
11
+ The fixture provides a running Dolt SQL service and validates availability with the container's bundled tools. Since
12
+ Dolt is MySQL-compatible, use the service attributes with the MySQL client, ORM, or application configuration you
13
+ normally use.
14
+
15
+ Usage Example
16
+ -------------
17
+
18
+ .. code-block:: python
19
+
20
+ import pytest
21
+ import mysql.connector
22
+ from pytest_databases.docker.dolt import DoltService
23
+
24
+ pytest_plugins = ["pytest_databases.docker.dolt"]
25
+
26
+ def test(dolt_service: DoltService) -> None:
27
+ with mysql.connector.connect(
28
+ host=dolt_service.host,
29
+ port=dolt_service.port,
30
+ user=dolt_service.user,
31
+ database=dolt_service.db,
32
+ password=dolt_service.password,
33
+ ) as conn, conn.cursor() as cursor:
34
+ cursor.execute("select 1 as is_available")
35
+ resp = cursor.fetchone()
36
+ assert resp is not None and resp[0] == 1
37
+
38
+ Available Fixtures
39
+ ------------------
40
+
41
+ * ``dolt_service``: A fixture that provides a Dolt service (latest).
42
+ * ``dolt_user``: The application user configured in the container.
43
+ * ``dolt_password``: The application user password configured in the container.
44
+ * ``dolt_root_password``: The root password configured in the container.
45
+ * ``dolt_database``: The initial database configured in the container.
46
+
47
+ Isolation Level
48
+ ---------------
49
+
50
+ By default, the ``dolt_service`` fixture uses ``database`` isolation, where each worker gets its own database on a shared server. You can change this to ``server`` isolation by overriding the ``xdist_dolt_isolation_level`` fixture.
51
+
52
+ .. code-block:: python
53
+
54
+ @pytest.fixture(scope="session")
55
+ def xdist_dolt_isolation_level():
56
+ return "server"
57
+
58
+ Service API
59
+ -----------
60
+
61
+ .. automodule:: pytest_databases.docker.dolt
62
+ :members:
63
+ :undoc-members:
64
+ :show-inheritance:
@@ -9,6 +9,7 @@ This section provides detailed information on the supported databases, including
9
9
  postgres
10
10
  mysql
11
11
  mariadb
12
+ dolt
12
13
  oracle
13
14
  sqlserver
14
15
  spanner
@@ -22,3 +23,4 @@ This section provides detailed information on the supported databases, including
22
23
  elasticsearch
23
24
  azure_blob_storage
24
25
  minio
26
+ rustfs
@@ -3,15 +3,11 @@ MariaDB
3
3
 
4
4
  Integration with `MariaDB <https://mariadb.org>`_, a community-developed, commercially supported fork of the MySQL relational database management system.
5
5
 
6
- This integration uses the official `MariaDB Python Connector <https://mariadb.com/docs/clients/mariadb-connectors/connector-python/>`_ to interact with MariaDB.
7
-
8
6
  Installation
9
7
  ------------
10
8
 
11
- .. code-block:: bash
12
-
13
- pip install pytest-databases[mariadb]
14
-
9
+ The fixture provides a running MariaDB service and validates availability with the container's bundled tools. Use the
10
+ service attributes with the MariaDB client, ORM, or application configuration you normally use.
15
11
 
16
12
  Usage Example
17
13
  -------------
@@ -36,24 +32,20 @@ Usage Example
36
32
  resp = cursor.fetchone()
37
33
  assert resp is not None and resp[0] == 1
38
34
 
39
- def test(mariadb_connection: mariadb.Connection) -> None:
40
- with mariadb_connection.cursor() as cursor:
41
- cursor.execute("CREATE TABLE if not exists simple_table as SELECT 1 as the_value")
42
- cursor.execute("select * from simple_table")
43
- result = cursor.fetchall()
44
- assert result is not None and result[0][0] == 1
45
-
46
35
  Available Fixtures
47
36
  ------------------
48
37
 
49
- * ``mariadb_service``: A fixture that provides a MariaDB service.
50
- * ``mariadb_connection``: A fixture that provides a MariaDB connection.
38
+ * ``mariadb_service``: A fixture that provides a MariaDB service (11.4 LTS).
39
+ * ``mariadb_user``: The application user configured in the container.
40
+ * ``mariadb_password``: The application user password configured in the container.
41
+ * ``mariadb_root_password``: The root password configured in the container.
42
+ * ``mariadb_database``: The initial database configured in the container.
51
43
 
52
44
  The following version-specific fixtures are also available:
53
45
 
54
- * ``mariadb_113_service``: A fixture that provides a MariaDB 11.3 service.
55
- * ``mariadb_113_connection``: A fixture that provides a MariaDB 11.3 connection.
56
-
46
+ * ``mariadb_113_service``: MariaDB 11.3
47
+ * ``mariadb_114_service``: MariaDB 11.4 LTS
48
+ * ``mariadb_122_service``: MariaDB 12.2 Rolling
57
49
 
58
50
  Service API
59
51
  -----------
@@ -6,9 +6,8 @@ Integration with `MySQL <https://www.mysql.com/>`_
6
6
  Installation
7
7
  ------------
8
8
 
9
- .. code-block:: bash
10
-
11
- pip install pytest-databases[mysql]
9
+ The fixture provides a running MySQL service and validates availability with the container's bundled tools. Use the
10
+ service attributes with the MySQL client, ORM, or application configuration you normally use.
12
11
 
13
12
  Usage Example
14
13
  -------------
@@ -33,24 +32,22 @@ Usage Example
33
32
  resp = cursor.fetchone()
34
33
  assert resp is not None and resp[0] == 1
35
34
 
36
- def test(mysql_connection: mysql.connector.MySQLConnection) -> None:
37
- with mysql_connection.cursor() as cursor:
38
- cursor.execute("CREATE TABLE if not exists simple_table as SELECT 1 as the_value")
39
- cursor.execute("select * from simple_table")
40
- result = cursor.fetchall()
41
- assert result is not None and result[0][0] == 1
42
-
43
35
  Available Fixtures
44
36
  ------------------
45
37
 
46
- * ``mysql_service``: A fixture that provides a MySQL service (latest version).
47
- * ``mysql_connection``: A fixture that provides a MySQL connection.
38
+ * ``mysql_service``: A fixture that provides a MySQL service (8.4 LTS).
39
+ * ``mysql_user``: The application user configured in the container.
40
+ * ``mysql_password``: The application user password configured in the container.
41
+ * ``mysql_root_password``: The root password configured in the container.
42
+ * ``mysql_database``: The initial database configured in the container.
48
43
 
49
44
  The following version-specific fixtures are also available:
50
45
 
51
- * ``mysql_56_service``, ``mysql_56_connection``: MySQL 5.6
52
- * ``mysql_57_service``, ``mysql_57_connection``: MySQL 5.7
53
- * ``mysql_8_service``, ``mysql_8_connection``: MySQL 8.x
46
+ * ``mysql_56_service``: MySQL 5.6
47
+ * ``mysql_57_service``: MySQL 5.7
48
+ * ``mysql_8_service``: MySQL 8.0
49
+ * ``mysql_84_service``: MySQL 8.4 LTS
50
+ * ``mysql_96_service``: MySQL 9.6 Innovation
54
51
 
55
52
  Service API
56
53
  -----------
@@ -1,7 +1,7 @@
1
1
  PostgreSQL
2
2
  ==========
3
3
 
4
- Integration with `PostgreSQL <https://www.postgresql.org/>`_ using the `PostgreSQL Docker Image <https://hub.docker.com/_/postgres>`_, Google's `AlloyDB Omni <https://cloud.google.com/alloydb/omni?hl=en>`_ or `pgvector Docker Image <https://hub.docker.com/r/ankane/pgvector>`_
4
+ Integration with `PostgreSQL <https://www.postgresql.org/>`_ using the `PostgreSQL Docker Image <https://hub.docker.com/_/postgres>`_, Google's `AlloyDB Omni <https://cloud.google.com/alloydb/omni?hl=en>`_, `pgvector Docker Image <https://hub.docker.com/r/ankane/pgvector>`_, or `ParadeDB Docker Image <https://hub.docker.com/r/paradedb/paradedb>`_
5
5
 
6
6
  Installation
7
7
  ------------
@@ -56,6 +56,7 @@ The following version-specific fixtures are also available:
56
56
  * ``postgres_17_image``, ``postgres_17_service``, ``postgres_17_connection``: PostgreSQL 17.x
57
57
  * ``postgres_18_image``, ``postgres_18_service``, ``postgres_18_connection``: PostgreSQL 18.x
58
58
  * ``pgvector_image``, ``pgvector_service``. ``pgvector_connection``: Latest Available pgvector Docker image.
59
+ * ``paradedb_image``, ``paradedb_service``, ``paradedb_connection``: ParadeDB (PostgreSQL with BM25 full-text search and analytics extensions).
59
60
 
60
61
  Configuration
61
62
  -------------
@@ -0,0 +1,76 @@
1
+ RustFS
2
+ ======
3
+
4
+ Integration with `RustFS <https://rustfs.com>`_, a high-performance, S3-compatible object storage service written in Rust.
5
+
6
+ This integration provides a Docker-managed RustFS service for testing S3-compatible storage without requiring any additional Python dependencies in the core package.
7
+
8
+ Installation
9
+ ------------
10
+
11
+ .. code-block:: bash
12
+
13
+ pip install pytest-databases
14
+
15
+ *Note: You will need to install your own S3 client library (e.g., ``boto3`` or ``minio``) to interact with the service in your tests.*
16
+
17
+ Docker Image
18
+ ------------
19
+
20
+ `Official RustFS Docker Image <https://hub.docker.com/r/rustfs/rustfs>`_
21
+
22
+ Configuration
23
+ -------------
24
+
25
+ * ``RUSTFS_ACCESS_KEY``: Access key for RustFS (default: "rustfsadmin")
26
+ * ``RUSTFS_SECRET_KEY``: Secret key for RustFS (default: "rustfsadmin")
27
+ * ``RUSTFS_SECURE``: Whether to use HTTPS (default: "false")
28
+ * ``RUSTFS_DEFAULT_BUCKET_NAME``: The default bucket to create (default: "pytest-databases")
29
+
30
+ Usage Example
31
+ -------------
32
+
33
+ Using ``boto3``:
34
+
35
+ .. code-block:: python
36
+
37
+ import boto3
38
+ from botocore.client import Config
39
+ from pytest_databases.docker.rustfs import RustfsService
40
+
41
+ pytest_plugins = ["pytest_databases.docker.rustfs"]
42
+
43
+ def test_with_boto3(rustfs_service: RustfsService, rustfs_default_bucket_name: str) -> None:
44
+ scheme = "https" if rustfs_service.secure else "http"
45
+ endpoint_url = f"{scheme}://{rustfs_service.endpoint}"
46
+
47
+ s3 = boto3.client(
48
+ "s3",
49
+ endpoint_url=endpoint_url,
50
+ aws_access_key_id=rustfs_service.access_key,
51
+ aws_secret_access_key=rustfs_service.secret_key,
52
+ config=Config(signature_version="s3v4"),
53
+ region_name="us-east-1",
54
+ )
55
+
56
+ # The default bucket is automatically created by the fixture
57
+ response = s3.list_buckets()
58
+ bucket_names = [b["Name"] for b in response["Buckets"]]
59
+ assert rustfs_default_bucket_name in bucket_names
60
+
61
+ Available Fixtures
62
+ ------------------
63
+
64
+ * ``rustfs_access_key``: The access key for RustFS (default: "rustfsadmin").
65
+ * ``rustfs_secret_key``: The secret key for RustFS (default: "rustfsadmin").
66
+ * ``rustfs_secure``: Whether to use HTTPS for RustFS (default: "false").
67
+ * ``rustfs_service``: A fixture that provides a RustFS service.
68
+ * ``rustfs_default_bucket_name``: A fixture that provides the default bucket name (automatically created).
69
+
70
+ Service API
71
+ -----------
72
+
73
+ .. automodule:: pytest_databases.docker.rustfs
74
+ :members:
75
+ :undoc-members:
76
+ :show-inheritance:
@@ -0,0 +1,48 @@
1
+ SQL Server
2
+ ==========
3
+
4
+ Integration with `Microsoft SQL Server <https://www.microsoft.com/en-us/sql-server/>`_ using the `Microsoft SQL Server Docker Image <https://hub.docker.com/_/microsoft-mssql-server>`_
5
+
6
+ Installation
7
+ ------------
8
+
9
+ .. code-block:: bash
10
+
11
+ pip install pytest-databases[mssql]
12
+
13
+ The ``mssql`` extra is kept as a compatibility group. The fixture provides a running SQL Server service and validates
14
+ availability with SQL Server's bundled tools. Install the SQL Server client library that your application already uses.
15
+
16
+ Usage Example
17
+ -------------
18
+
19
+ .. code-block:: python
20
+
21
+ import pyodbc
22
+ from pytest_databases.docker.mssql import MSSQLService
23
+
24
+ pytest_plugins = ["pytest_databases.docker.mssql"]
25
+
26
+ def test_sql_server_service(mssql_service: MSSQLService) -> None:
27
+ with pyodbc.connect(mssql_service.connection_string) as conn:
28
+ cursor = conn.cursor()
29
+ cursor.execute("SELECT 1 AS is_available")
30
+ row = cursor.fetchone()
31
+ assert row is not None and row[0] == 1
32
+
33
+ Available Fixtures
34
+ ------------------
35
+
36
+ * ``mssql_image``: The Docker image to use for SQL Server.
37
+ * ``mssql_user``: The SQL Server user exposed on ``mssql_service``.
38
+ * ``mssql_password``: The SQL Server password exposed on ``mssql_service``.
39
+ * ``mssql_database``: The database created for ``mssql_service``.
40
+ * ``mssql_service``: A fixture that provides a SQL Server service.
41
+
42
+ Service API
43
+ -----------
44
+
45
+ .. automodule:: pytest_databases.docker.mssql
46
+ :members:
47
+ :undoc-members:
48
+ :show-inheritance:
@@ -10,6 +10,9 @@ Installation
10
10
 
11
11
  pip install pytest-databases[yugabyte]
12
12
 
13
+ The fixture provides a running Yugabyte service and validates availability with Yugabyte's bundled tools. Use the
14
+ service attributes with the PostgreSQL-compatible client, ORM, or application configuration you normally use.
15
+
13
16
  Usage Example
14
17
  -------------
15
18
 
@@ -23,26 +26,24 @@ Usage Example
23
26
 
24
27
  @pytest.fixture(scope="session")
25
28
  def yugabyte_uri(yugabyte_service: YugabyteService) -> str:
26
- opts = "&".join(f"{k}={v}" for k, v in yugabyte_service.driver_opts.items())
27
- return f"postgresql://yugabyte:yugabyte@{yugabyte_service.host}:{yugabyte_service.port}/{yugabyte_service.database}?{opts}"
29
+ return (
30
+ f"postgresql://{yugabyte_service.user}:{yugabyte_service.password}"
31
+ f"@{yugabyte_service.host}:{yugabyte_service.port}/{yugabyte_service.database}?sslmode=disable"
32
+ )
28
33
 
29
34
  def test_yugabyte_service(yugabyte_uri: str) -> None:
30
35
  with psycopg.connect(yugabyte_uri) as conn:
31
36
  db_open = conn.execute("SELECT 1").fetchone()
32
37
  assert db_open is not None and db_open[0] == 1
33
38
 
34
- def test_yugabyte_connection(yugabyte_connection: psycopg.Connection) -> None:
35
- yugabyte_connection.execute("CREATE TABLE if not exists simple_table as SELECT 1")
36
- result = yugabyte_connection.execute("select * from simple_table").fetchone()
37
- assert result is not None and result[0] == 1
38
-
39
39
  Available Fixtures
40
40
  ------------------
41
41
 
42
42
  * ``yugabyte_image``: The Docker image to use for Yugabyte DB.
43
+ * ``yugabyte_user``: The Yugabyte user exposed on ``yugabyte_service``.
44
+ * ``yugabyte_password``: The Yugabyte password exposed on ``yugabyte_service``.
45
+ * ``yugabyte_database``: The database created for ``yugabyte_service``.
43
46
  * ``yugabyte_service``: A fixture that provides a Yugabyte DB service.
44
- * ``yugabyte_connection``: A fixture that provides a Yugabyte DB connection.
45
- * ``yugabyte_driver_opts``: A fixture that provides driver options for Yugabyte DB.
46
47
 
47
48
  Service API
48
49
  -----------
@@ -12,7 +12,7 @@ license = "MIT"
12
12
  name = "pytest-databases"
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.9"
15
- version = "0.16.0"
15
+ version = "0.18.0"
16
16
  #
17
17
  authors = [{ name = "Cody Fincher", email = "cody@litestar.dev" }]
18
18
  keywords = [
@@ -28,6 +28,7 @@ keywords = [
28
28
  "alloydb",
29
29
  "alloydbomni",
30
30
  "cockroachdb",
31
+ "doltdb",
31
32
  "redis",
32
33
  "elasticsearch",
33
34
  "azure",
@@ -66,17 +67,16 @@ elasticsearch7 = ["elasticsearch7"]
66
67
  elasticsearch8 = ["elasticsearch8"]
67
68
  gizmosql = ["adbc-driver-flightsql", "pyarrow"]
68
69
  keydb = ["redis"]
69
- mariadb = ["mariadb"]
70
- minio = ["minio"]
70
+ mariadb = []
71
71
  mongodb = ["pymongo"]
72
- mssql = ["pymssql"]
73
- mysql = ["mysql-connector-python"]
72
+ mssql = []
73
+ mysql = []
74
74
  oracle = ["oracledb"]
75
75
  postgres = ["psycopg>=3"]
76
76
  redis = ["redis"]
77
77
  spanner = ["google-cloud-spanner"]
78
78
  valkey = ["valkey"]
79
- yugabyte = ["psycopg2-yugabytedb"]
79
+ yugabyte = []
80
80
 
81
81
  [dependency-groups]
82
82
  build = ["bump-my-version"]
@@ -104,7 +104,7 @@ doc = [
104
104
  "sphinx-autodoc-typehints",
105
105
  "sphinx-rtd-theme",
106
106
  ]
107
- extra = ["psycopg2-binary", "psycopg[binary,pool]", "psycopg2-yugabytedb-binary"]
107
+ extra = ["psycopg[binary,pool]"]
108
108
  lint = [
109
109
  "mypy",
110
110
  "ruff",
@@ -138,7 +138,7 @@ test = [
138
138
  allow_dirty = true
139
139
  commit = false
140
140
  commit_args = "--no-verify"
141
- current_version = "0.16.0"
141
+ current_version = "0.18.0"
142
142
  ignore_missing_files = false
143
143
  ignore_missing_version = false
144
144
  message = "chore(release): bump to `v{new_version}`"