Fix category budget overlaps and document the uv run test workflow.
This commit is contained in:
@@ -7,15 +7,17 @@
|
||||
uv sync
|
||||
|
||||
# Run migrations
|
||||
alembic upgrade head
|
||||
uv run alembic upgrade head
|
||||
|
||||
# Run all tests
|
||||
pytest
|
||||
uv run pytest
|
||||
|
||||
# Run a single test file
|
||||
pytest tests/test_model_b4wexport.py -v
|
||||
uv run pytest tests/test_model_b4wexport.py -v
|
||||
```
|
||||
|
||||
Use `uv run` for project commands so they use the project-managed Python environment and dependencies.
|
||||
|
||||
## Project Structure
|
||||
|
||||
- **`src/`**: Application code
|
||||
@@ -53,10 +55,10 @@ with get_session() as session:
|
||||
|
||||
```bash
|
||||
# Tests automatically run migrations via conftest fixture
|
||||
pytest tests/ -v --tb=short
|
||||
uv run pytest tests/ -v --tb=short
|
||||
|
||||
# To test without migrations (in-memory SQLite), use DATABASE_URL="sqlite://"
|
||||
export DATABASE_URL="sqlite://" pytest tests/test_db.py
|
||||
DATABASE_URL="sqlite://" uv run pytest tests/test_db.py
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
@@ -129,7 +131,7 @@ item = B4wExportFactory.build( # build() for partial, create() for full
|
||||
|
||||
## Testing Tips
|
||||
|
||||
- Run single test: `pytest tests/test_model_b4wexport.py -v`
|
||||
- Run single test: `uv run pytest tests/test_model_b4wexport.py -v`
|
||||
- View migrations: `ls alembic/versions/`
|
||||
- Test data location: `/scripts/dummy_data/`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user