GuideIntermediate
Testing Backend Applications Guide
Learn backend testing end to end: pytest fundamentals, fixtures, mocking with unittest.mock and pytest-mock, integration testing with test databases and factories, E2E testing with the FastAPI TestClient, coverage with pytest-cov, the TDD workflow, and CI with GitHub Actions. Build a production-grade test suite with 80%+ coverage.
- 48
- lessons
- 6
- modules
- English · Spanish
- available in
- Yes
- certificate
- Free
- access
Outcomes
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
Before you start
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
Content
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
Where it fits
This guide is part of something bigger
It's studied inside these programs, with support and dates.
Common questions
What people usually ask
No limit. It's a free 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 Club's WhatsApp group, and every two weeks there's a live with an instructor where questions get worked through.
Yes. It's issued automatically once you finish every lesson, with a verifiable code you can share on LinkedIn.
No. This guide is self-paced with no dates. The bootcamp is live, by cohort, with work someone reviews.
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!