pytest-neon 2.3.0__tar.gz → 2.3.1__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_neon-2.3.0 → pytest_neon-2.3.1}/PKG-INFO +1 -1
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/pyproject.toml +1 -1
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/src/pytest_neon/__init__.py +1 -1
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/src/pytest_neon/plugin.py +24 -13
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/uv.lock +1 -1
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.config/wt.toml +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.env.example +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.github/workflows/release.yml +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.github/workflows/tests.yml +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.gitignore +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/.neon +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/CLAUDE.md +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/LICENSE +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/README.md +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/src/pytest_neon/py.typed +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/conftest.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_branch_lifecycle.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_branch_name_prefix.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_cli_options.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_default_branch_safety.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_dirty_isolated_fixtures.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_env_var.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_fixture_errors.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_integration.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_migrations.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_readwrite_readonly_fixtures.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_reset_behavior.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_service_classes.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_skip_behavior.py +0 -0
- {pytest_neon-2.3.0 → pytest_neon-2.3.1}/tests/test_xdist_worker_support.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-neon
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Pytest plugin for Neon database branch isolation in tests
|
|
5
5
|
Project-URL: Homepage, https://github.com/ZainRizvi/pytest-neon
|
|
6
6
|
Project-URL: Repository, https://github.com/ZainRizvi/pytest-neon
|
|
@@ -295,6 +295,17 @@ def _get_git_branch_name() -> str | None:
|
|
|
295
295
|
return None
|
|
296
296
|
|
|
297
297
|
|
|
298
|
+
def _extract_password_from_connection_string(connection_string: str) -> str:
|
|
299
|
+
"""Extract password from a PostgreSQL connection string."""
|
|
300
|
+
# Format: postgresql://user:password@host/db?params
|
|
301
|
+
from urllib.parse import urlparse
|
|
302
|
+
|
|
303
|
+
parsed = urlparse(connection_string)
|
|
304
|
+
if parsed.password:
|
|
305
|
+
return parsed.password
|
|
306
|
+
raise ValueError(f"No password found in connection string: {connection_string}")
|
|
307
|
+
|
|
308
|
+
|
|
298
309
|
def _get_schema_fingerprint(connection_string: str) -> tuple[tuple[Any, ...], ...]:
|
|
299
310
|
"""
|
|
300
311
|
Get a fingerprint of the database schema for change detection.
|
|
@@ -537,9 +548,15 @@ class NeonBranchManager:
|
|
|
537
548
|
endpoint_id = result.endpoint.id
|
|
538
549
|
host = self._wait_for_endpoint(endpoint_id)
|
|
539
550
|
|
|
540
|
-
#
|
|
541
|
-
|
|
542
|
-
|
|
551
|
+
# Reuse the password from the parent branch's connection string.
|
|
552
|
+
# DO NOT call role_password_reset here - it would invalidate the
|
|
553
|
+
# password used by the parent branch's read_write endpoint, breaking
|
|
554
|
+
# any existing connections (especially in xdist where other workers
|
|
555
|
+
# may be using the cached connection string).
|
|
556
|
+
password = _extract_password_from_connection_string(branch.connection_string)
|
|
557
|
+
connection_string = (
|
|
558
|
+
f"postgresql://{self.config.role_name}:{password}@{host}/"
|
|
559
|
+
f"{self.config.database_name}?sslmode=require"
|
|
543
560
|
)
|
|
544
561
|
|
|
545
562
|
return NeonBranch(
|
|
@@ -1170,16 +1187,10 @@ def _create_readonly_endpoint(
|
|
|
1170
1187
|
|
|
1171
1188
|
host = endpoint.host
|
|
1172
1189
|
|
|
1173
|
-
#
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
branch_id=branch.branch_id,
|
|
1178
|
-
role_name=role_name,
|
|
1179
|
-
),
|
|
1180
|
-
operation_name="role_password_reset_readonly",
|
|
1181
|
-
)
|
|
1182
|
-
password = password_response.role.password
|
|
1190
|
+
# Reuse the password from the parent branch's connection string.
|
|
1191
|
+
# DO NOT call role_password_reset here - it would invalidate the
|
|
1192
|
+
# password used by the parent branch's read_write endpoint.
|
|
1193
|
+
password = _extract_password_from_connection_string(branch.connection_string)
|
|
1183
1194
|
|
|
1184
1195
|
# Build connection string for the read_only endpoint
|
|
1185
1196
|
connection_string = (
|
|
@@ -1212,7 +1212,7 @@ wheels = [
|
|
|
1212
1212
|
|
|
1213
1213
|
[[package]]
|
|
1214
1214
|
name = "pytest-neon"
|
|
1215
|
-
version = "2.3.
|
|
1215
|
+
version = "2.3.1"
|
|
1216
1216
|
source = { editable = "." }
|
|
1217
1217
|
dependencies = [
|
|
1218
1218
|
{ name = "filelock", version = "3.19.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|