Continues the test-isolation work from dab740d. RLS migration tests run
against a policy-installed database and fail in the default create_all
suite, so they need to be opt-in:
- pytest.ini: register `rls` marker.
- conftest.py: auto-deselect test_rls_isolation.py unless
RUN_RLS_TESTS=1. Drops the deprecated session-scoped event_loop
fixture (not needed since pytest-asyncio 0.23+).
- test_rls_isolation.py: tag module with `rls` marker. Replace
hardcoded `patherly_test` DB reference with parsed DATABASE_TEST_URL
(matches conftest.py default `resolutionflow_test`). Updated docstring
command to show RUN_RLS_TESTS=1.
- requirements-dev.txt: bump pytest-asyncio 0.23.0 → 0.24.0 (loop-scope
marker behavior required by the RLS module fixture).
Run the RLS suite with:
RUN_RLS_TESTS=1 DB_APP_ROLE_PASSWORD=... pytest tests/test_rls_isolation.py
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
41 lines
899 B
INI
41 lines
899 B
INI
[pytest]
|
|
# Pytest configuration for Patherly backend tests
|
|
|
|
# Python path - add current directory so 'app' module can be imported
|
|
pythonpath = .
|
|
|
|
# Asyncio configuration
|
|
asyncio_mode = auto
|
|
|
|
# Test discovery patterns
|
|
python_files = test_*.py
|
|
python_classes = Test*
|
|
python_functions = test_*
|
|
|
|
# Output options
|
|
addopts =
|
|
-v
|
|
--strict-markers
|
|
--tb=short
|
|
--cov=app
|
|
--cov-report=term-missing
|
|
--cov-report=html
|
|
|
|
# Test markers
|
|
markers =
|
|
asyncio: marks tests as async
|
|
slow: marks tests as slow (deselect with '-m "not slow"')
|
|
integration: marks tests as integration tests
|
|
unit: marks tests as unit tests
|
|
rls: opt-in RLS migration and policy tests (run with RUN_RLS_TESTS=1)
|
|
|
|
# Ignore paths
|
|
testpaths = tests
|
|
|
|
# Warnings
|
|
filterwarnings =
|
|
error
|
|
ignore::DeprecationWarning
|
|
ignore::PendingDeprecationWarning
|
|
ignore::pluggy.PluggyTeardownRaisedWarning
|