GuideIntermediate
Testing Backend Applications Guide
Learn backend testing in Python end to end: pytest 9 with fixtures, parametrize and conftest; mocking with unittest.mock and pytest-mock; integration tests against a real PostgreSQL with SQLAlchemy 2.1, testcontainers and factory_boy; E2E tests for FastAPI with TestClient and AsyncClient; coverage with pytest-cov, the TDD cycle, and CI with GitHub Actions. You finish with a production-grade test suite at 80% coverage or more.
- lessons
- 48
- modules
- 6
- available in
- English · Spanish
- certificate
- Yes
- access
- Free

What you'll be able to do
- Pytest Fundamentals: Fixtures, parametrize, markers, conftest.py, plugins
- Unit Testing: Functions, classes, dependency isolation, advanced assertions
- Mocking: unittest.mock, pytest-mock, patching, side effects, spec
- Integration Testing: Test databases, SQLAlchemy fixtures, factories with factory_boy
- E2E Testing: FastAPI TestClient, full workflows, auth testing
- Coverage: pytest-cov, coverage reports, thresholds, branch coverage
- TDD: Red → Green → Refactor, test-first development
- CI: GitHub Actions, test pipeline, automated coverage checks
What you need to bring
Requirements and materials
- FastAPI Fundamentals and Advanced completed (#6-#7)
- PostgreSQL & SQLAlchemy Guide completed (#8)
- Authentication & Authorization Guide completed (#9)
- A working API with endpoints, models and auth
The syllabus, module by module
Open any of them to see its lessons.
- Module 2: Unit Testing and Mocking
- Pure unit testing: functions without dependencies
- `unittest.mock` fundamentals
- pytest-mock: the `mocker` fixture
- `side_effect`: complex behaviors
- `spec` and `autospec`: mocks that respect the interface
- Service + Repository pattern with mocks
- Project: unit tests with mocks for business logic
- Module 3: Integration Testing
- Test database: SQLite in-memory vs real Postgres
- SQLAlchemy fixtures: the canonical pattern
- factory_boy: test data that scales
- Repository tests against a real DB
- Service tests with a DB + external APIs
- Mocking external APIs with respx and responses
- Project: a complete integration test suite
Keep going with the full bootcamp.
At your own pace or 1:1, whichever you need.
What people usually ask
No limit. It's an open guide: come in whenever you like, as often as you like.
No. Modules run from easier to harder, but you can jump to the one you need. Progress is saved per lesson.
Whatever is needed is listed under “What you need to bring”, above. If nothing is listed there, you can start from zero.
In the forum and in the community WhatsApp group.
Yes. When you finish every lesson you get a statement of completion. Pass the guide's certification exam and it becomes a certificate, with a verifiable code you can share on LinkedIn.
No. This guide is one piece. The bootcamp puts the whole syllabus in order, with videos and projects, at your own pace.
Start whenever you like
What students say
These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.
No approved reviews yet.
Be the first to share your experience!