perf: Optimize slow tests with shared tenant fixtures

- Add session-scoped shared_tenant and second_shared_tenant fixtures to conftest.py
- Refactor test_models.py and test_user_model.py to use shared fixtures
- Avoid ~40s migration overhead per tenant by reusing fixtures across tests
- Add pytest-xdist to dev dependencies for future parallel test execution

Previously 4 tests each created their own tenant (~40s each = ~160s total).
Now they share session-scoped tenants, reducing overhead significantly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-10 02:22:43 -05:00
parent 485f86086b
commit ba2c656243
4 changed files with 96 additions and 103 deletions

View File

@@ -146,6 +146,7 @@ dev = [
"pytest==9.0.1",
"pytest-django==4.11.1",
"pytest-sugar==1.1.1",
"pytest-xdist>=3.5.0",
"ruff==0.14.6",
"sphinx==8.2.3",
"sphinx-autobuild==2025.8.25",