Throughout this book, we've stressed the fact that unit tests are not integration tests. They have a different purpose to validating that the system works when integrated. Having said that, integration tests are also important and shouldn't be ignored. Integration tests can be written using the same
unittest framework that we use for writing unit tests. The key points to keep in mind when writing integration tests are as follows:
Still disable non-core services: Keep non-core services such as analytics or logging disabled. These do not affect the functionality of the application.
Enable all core services: Every other service should be live. We don't want to mock or fake these because this defeats the whole purpose of an integration test.
Use attributes to tag integration tests: By doing this, we can easily select only the unit tests to run during development, while enabling integration tests to be run during continuous integration or before deployment...