Defining your build container in Docker means your build is run in the same environment everywhere. Run the same build process, in the same environment, locally and in CI.
Spin up a MongoDB instance just for your tests. Drop in a Redis container to test your caching.
Run your tests in multiple environments. Need to support python 2 and python 3? MySQL and PostgreSQL? No problem.