Skip to content

integration test

An integration test is a check that exercises several modules together to confirm they work correctly once combined, focusing on the interfaces and data passed between them rather than on each part in isolation.

It sits between the unit test, which checks a single component alone, and the system test, which exercises the fully assembled product. This layering is often pictured with the test pyramid.

An integration test takes already unit-tested modules as its input and aims to expose faults that surface only where parts meet, such as mismatched data formats or broken call contracts.

Modules can be combined in several orders, each with its own trade-offs:

  • Big bang, where every module is joined at once, which is quick to arrange but makes a failure hard to isolate.
  • Top-down, which starts at the highest-level modules and works down, standing in for the lower modules they call with placeholders called stubs.
  • Bottom-up, which starts at the lowest-level modules and works up, using temporary driver programs in place of the higher-level code not yet integrated.
  • Sandwich (or hybrid), which runs both directions at once so they meet in the middle.

Pick a strategy below and step through it to watch the modules join the growing integration in that order, with stubs and drivers standing in for the parts not yet connected:

Interactive diagram — enable JavaScript to view.

The last three approaches are incremental, adding modules a few at a time so each new failure points at the most recently joined interface. Python developers usually write integration tests with the same tools as unit tests, such as pytest or unittest.

How to Provide Test Fixtures for Django Models in Pytest

Tutorial

How to Provide Test Fixtures for Django Models in Pytest

In this step-by-step tutorial, you'll learn how to use fixtures to simplify your testing in pytest. If you use Django, pytest fixtures can help you write tests that are painless to update and maintain even as you make changes to your models.

intermediate django testing

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated July 22, 2026