pytest-neon 2.1.4__tar.gz → 2.2.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.
Files changed (29) hide show
  1. pytest_neon-2.2.1/.config/wt.toml +4 -0
  2. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/.github/workflows/release.yml +4 -1
  3. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/PKG-INFO +17 -1
  4. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/README.md +15 -0
  5. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/pyproject.toml +2 -1
  6. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/src/pytest_neon/__init__.py +1 -1
  7. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/src/pytest_neon/plugin.py +436 -78
  8. pytest_neon-2.2.1/tests/test_reset_behavior.py +581 -0
  9. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_xdist_worker_support.py +49 -0
  10. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/uv.lock +28 -13
  11. pytest_neon-2.1.4/tests/test_reset_behavior.py +0 -378
  12. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/.env.example +0 -0
  13. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/.github/workflows/tests.yml +0 -0
  14. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/.gitignore +0 -0
  15. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/.neon +0 -0
  16. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/CLAUDE.md +0 -0
  17. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/LICENSE +0 -0
  18. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/src/pytest_neon/py.typed +0 -0
  19. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/conftest.py +0 -0
  20. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_branch_lifecycle.py +0 -0
  21. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_branch_name_prefix.py +0 -0
  22. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_cli_options.py +0 -0
  23. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_default_branch_safety.py +0 -0
  24. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_env_var.py +0 -0
  25. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_fixture_errors.py +0 -0
  26. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_integration.py +0 -0
  27. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_migrations.py +0 -0
  28. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_readwrite_readonly_fixtures.py +0 -0
  29. {pytest_neon-2.1.4 → pytest_neon-2.2.1}/tests/test_skip_behavior.py +0 -0
@@ -0,0 +1,4 @@
1
+ # Worktrunk project configuration for pytest-neon
2
+
3
+ # Create fresh uv venv and install all dependencies when creating worktrees
4
+ post-create = "uv venv && uv sync --all-extras"
@@ -92,13 +92,16 @@ jobs:
92
92
  # Update __init__.py
93
93
  sed -i "s/__version__ = \".*\"/__version__ = \"$new_version\"/" src/pytest_neon/__init__.py
94
94
 
95
+ # Update uv.lock to reflect new version
96
+ uv lock
97
+
95
98
  - name: Commit version bump
96
99
  env:
97
100
  VERSION: ${{ steps.bump.outputs.version }}
98
101
  run: |
99
102
  git config user.name "github-actions[bot]"
100
103
  git config user.email "github-actions[bot]@users.noreply.github.com"
101
- git add pyproject.toml src/pytest_neon/__init__.py
104
+ git add pyproject.toml src/pytest_neon/__init__.py uv.lock
102
105
  git commit -m "Release v$VERSION"
103
106
  git tag "v$VERSION"
104
107
  git push origin main --tags
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-neon
3
- Version: 2.1.4
3
+ Version: 2.2.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
@@ -24,6 +24,7 @@ Classifier: Programming Language :: Python :: 3.14
24
24
  Classifier: Topic :: Database
25
25
  Classifier: Topic :: Software Development :: Testing
26
26
  Requires-Python: >=3.9
27
+ Requires-Dist: filelock>=3.0
27
28
  Requires-Dist: neon-api>=0.1.0
28
29
  Requires-Dist: pytest>=7.0
29
30
  Requires-Dist: requests>=2.20
@@ -489,6 +490,21 @@ The `neon_branch_readwrite` fixture uses Neon's branch restore API to reset data
489
490
 
490
491
  This is similar to database transactions but at the branch level.
491
492
 
493
+ ## Branch Naming
494
+
495
+ Branches are automatically named to help identify their source:
496
+
497
+ ```
498
+ pytest-[git-branch]-[random]-[suffix]
499
+ ```
500
+
501
+ **Examples:**
502
+ - `pytest-main-a1b2-migrated` - Migration branch from `main`
503
+ - `pytest-feature-auth-c3d4-test-main` - Test branch from `feature/auth`
504
+ - `pytest-a1b2-migrated` - When not in a git repo
505
+
506
+ The git branch name is sanitized (only `a-z`, `0-9`, `-`, `_` allowed) and truncated to 15 characters. This makes it easy to identify orphaned branches in the Neon console.
507
+
492
508
  ## Parallel Test Execution (pytest-xdist)
493
509
 
494
510
  This plugin supports parallel test execution with [pytest-xdist](https://pytest-xdist.readthedocs.io/). Each xdist worker automatically gets its own isolated branch.
@@ -444,6 +444,21 @@ The `neon_branch_readwrite` fixture uses Neon's branch restore API to reset data
444
444
 
445
445
  This is similar to database transactions but at the branch level.
446
446
 
447
+ ## Branch Naming
448
+
449
+ Branches are automatically named to help identify their source:
450
+
451
+ ```
452
+ pytest-[git-branch]-[random]-[suffix]
453
+ ```
454
+
455
+ **Examples:**
456
+ - `pytest-main-a1b2-migrated` - Migration branch from `main`
457
+ - `pytest-feature-auth-c3d4-test-main` - Test branch from `feature/auth`
458
+ - `pytest-a1b2-migrated` - When not in a git repo
459
+
460
+ The git branch name is sanitized (only `a-z`, `0-9`, `-`, `_` allowed) and truncated to 15 characters. This makes it easy to identify orphaned branches in the Neon console.
461
+
447
462
  ## Parallel Test Execution (pytest-xdist)
448
463
 
449
464
  This plugin supports parallel test execution with [pytest-xdist](https://pytest-xdist.readthedocs.io/). Each xdist worker automatically gets its own isolated branch.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pytest-neon"
7
- version = "2.1.4"
7
+ version = "2.2.1"
8
8
  description = "Pytest plugin for Neon database branch isolation in tests"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -31,6 +31,7 @@ dependencies = [
31
31
  "pytest>=7.0",
32
32
  "neon-api>=0.1.0",
33
33
  "requests>=2.20",
34
+ "filelock>=3.0",
34
35
  ]
35
36
 
36
37
  [project.optional-dependencies]
@@ -9,7 +9,7 @@ from pytest_neon.plugin import (
9
9
  neon_engine,
10
10
  )
11
11
 
12
- __version__ = "2.1.4"
12
+ __version__ = "2.2.1"
13
13
  __all__ = [
14
14
  "NeonBranch",
15
15
  "neon_branch",