[chore] Scope integration fixtures per backend subdirectory #54

Merged
brian merged 1 commits from cursor/scoped-integration-fixtures into main 2026-07-10 21:16:29 +02:00
Owner

Summary

  • Split Redis and MinIO container fixtures out of the shared tests/integration/conftest.py into per-backend subdirectories (redis/, minio/, examples/)
  • Running pytest tests/integration/redis/ or tests/integration/minio/ now only imports and starts the container that backend needs
  • Added needs_redis and needs_minio markers for backend-specific filtering
  • Updated README with scoped integration test commands

Details

  • tests/integration/conftest.py now only holds shared configure_logging
  • Container lifecycle lives in backend-specific _containers.py helpers with reference-counted session singletons, so the full integration suite still starts each container once
  • examples/conftest.py reuses both backends via thin fixture wrappers (pytest 9 no longer allows pytest_plugins in non-top-level conftest files)

Test plan

  • uv run pytest tests/integration/redis/ -v
  • uv run pytest tests/integration/minio/ -v
  • uv run pytest -m integration -v
  • uv run pytest tests/unit/ -m "not integration" -v
## Summary - Split Redis and MinIO container fixtures out of the shared `tests/integration/conftest.py` into per-backend subdirectories (`redis/`, `minio/`, `examples/`) - Running `pytest tests/integration/redis/` or `tests/integration/minio/` now only imports and starts the container that backend needs - Added `needs_redis` and `needs_minio` markers for backend-specific filtering - Updated README with scoped integration test commands ## Details - `tests/integration/conftest.py` now only holds shared `configure_logging` - Container lifecycle lives in backend-specific `_containers.py` helpers with reference-counted session singletons, so the full integration suite still starts each container once - `examples/conftest.py` reuses both backends via thin fixture wrappers (pytest 9 no longer allows `pytest_plugins` in non-top-level conftest files) ## Test plan - [x] `uv run pytest tests/integration/redis/ -v` - [x] `uv run pytest tests/integration/minio/ -v` - [x] `uv run pytest -m integration -v` - [x] `uv run pytest tests/unit/ -m "not integration" -v`
brian added 1 commit 2026-07-10 21:13:56 +02:00
Scope integration fixtures per backend subdirectory.
PR Title Check / check-title (pull_request) Successful in 7s
Test Python Package / unit-tests (pull_request) Successful in 13s
Test Python Package / integration-tests (pull_request) Successful in 23s
Test Python Package / coverage-report (pull_request) Successful in 10s
Code Quality Pipeline / code-quality (pull_request) Successful in 49s
b28ac6e803
Split Redis and MinIO container setup into backend-specific conftest modules so only the containers needed for collected tests are imported and started.

Co-authored-by: Cursor <cursoragent@cursor.com>
Member

Test Coverage Report:

Name                                                            Stmts   Miss    Cover   Missing
-----------------------------------------------------------------------------------------------
python_repositories/__init__.py                                    12      0  100.00%
python_repositories/adapters/__init__.py                           13      0  100.00%
python_repositories/adapters/connection_aware_adapter.py           61      0  100.00%
python_repositories/adapters/minio_adapter.py                     117      0  100.00%
python_repositories/adapters/redis_adapter.py                     105      0  100.00%
python_repositories/config/__init__.py                              4      0  100.00%
python_repositories/config/dotenv_loader.py                         7      0  100.00%
python_repositories/config/env_bool.py                             14      0  100.00%
python_repositories/config/minio_config.py                         21      0  100.00%
python_repositories/config/redis_config.py                         14      0  100.00%
python_repositories/examples/__init__.py                            0      0  100.00%
python_repositories/examples/artifact_object_repository.py          9      0  100.00%
python_repositories/examples/user_json_repository.py               11      0  100.00%
python_repositories/interfaces/__init__.py                          5      0  100.00%
python_repositories/interfaces/connection_aware_interface.py        8      0  100.00%
python_repositories/interfaces/context_aware_interface.py           8      0  100.00%
python_repositories/interfaces/json_repository_interface.py        15      0  100.00%
python_repositories/interfaces/object_repository_interface.py      11      0  100.00%
-----------------------------------------------------------------------------------------------
TOTAL                                                             435      0  100.00%

**Test Coverage Report:** ``` Name Stmts Miss Cover Missing ----------------------------------------------------------------------------------------------- python_repositories/__init__.py 12 0 100.00% python_repositories/adapters/__init__.py 13 0 100.00% python_repositories/adapters/connection_aware_adapter.py 61 0 100.00% python_repositories/adapters/minio_adapter.py 117 0 100.00% python_repositories/adapters/redis_adapter.py 105 0 100.00% python_repositories/config/__init__.py 4 0 100.00% python_repositories/config/dotenv_loader.py 7 0 100.00% python_repositories/config/env_bool.py 14 0 100.00% python_repositories/config/minio_config.py 21 0 100.00% python_repositories/config/redis_config.py 14 0 100.00% python_repositories/examples/__init__.py 0 0 100.00% python_repositories/examples/artifact_object_repository.py 9 0 100.00% python_repositories/examples/user_json_repository.py 11 0 100.00% python_repositories/interfaces/__init__.py 5 0 100.00% python_repositories/interfaces/connection_aware_interface.py 8 0 100.00% python_repositories/interfaces/context_aware_interface.py 8 0 100.00% python_repositories/interfaces/json_repository_interface.py 15 0 100.00% python_repositories/interfaces/object_repository_interface.py 11 0 100.00% ----------------------------------------------------------------------------------------------- TOTAL 435 0 100.00% ```
brian merged commit 093e538d5b into main 2026-07-10 21:16:29 +02:00
brian deleted branch cursor/scoped-integration-fixtures 2026-07-10 21:16:30 +02:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lille-vemmelund/python-repositories#54