Software Development with Claude Code
Dani Zysman
AI Curriculum Manager @ DataCamp

Same workflow: ask Claude to write the tests!

music-analytics-api/
app.py
routes.py
models.py
db_routes.py # Database-backed Blueprint
chinook.db
test_routes.py # Unit tests (Ch.2)
test_db_routes.py # <- Integration tests
CLAUDE.md
> Generate pytest integration tests for @db_routes.py and run them
Test Coverage TestGetArtistAlbums: Core functionality - Retrieval, sorting, 404s, invalid IDs TestDatabaseConnection: Connection handling - Path, closure on success and error TestErrorHandling: 500 on database errors TestResponseFormat: JSON format and field validation Uses temporary SQLite database, independent of chinook.dbRan all 23 tests: Passed!
Software Development with Claude Code